I want to display a text on the screen in Minecraft 1.18 with MCP-Reborn. I have watched tutorials on YouTube but they only cover how to do it in 1.12, after around 4 hours of searching the internet I didn't find anything for 1.18. In 1.12 they used Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color);
.
Yeah there is like no documentation on mcp reborn :/
But to display text you can use:
Minecraft.getInstance().font.draw(poseStack, "Your text", x, y, color);
PoseStack is only in the newer minecraft code so i previously never heard of it. If you draw the text in a gui with the render method (in previous versions called drawScreen) you can just use the passed PoseStack, else i would probably just create a new instance, works aswell.
x, y and color are the same as in 1.8 and 1.12
font is pretty much the new fontrendererobj
I hope this is helpful