Minecraft mc = Minecraft.getInstance();
mc.fontRenderer.drawString("Gay", 10, 10, 16777215);
I figured it out. I know how to call methods in Java just that i don't know which classes have these methods.
Now i don't know how to render a rectangle for health bar.
Also what class should I extend? Earlier we could override render function of Gui class.
I am guessing Screen is the replaced one so i tried to make this class:
package com.example.examplemod.client.gui;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.util.text.ITextComponent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class ExampleHUD extends Screen {
private static final Logger LOGGER = LogManager.getLogger();
protected ExampleHUD(ITextComponent titleIn) {
super(titleIn);
}
}
But when i do:
@SubscribeEvent
public void onRender(RenderGameOverlayEvent.Pre event) {
Minecraft mc = Minecraft.getInstance();
mc.displayGuiScreen(new ExampleHUD());
}
I get errror:
'ExampleHUD(net.minecraft.util.text.ITextComponent)' has protected access in 'com.example.examplemod.client.gui.ExampleHUD
I having the same issue with stable but with snapshots you need to put version in the end, like 20200119-1.14.4. Good luck
EDIT: Also no need snapshot_
As the title says. I couldn't find much online. I don't want to use ContainerScreen because I think that is for a different purpose.
Also this is my first post here
EDIT: Also why doesn't it work when i put stable_58 in build.gradle?
mappings channel: 'snapshot', version: 'stable_58'
I had to use 20200119-1.14.4 instead.