[SOLVED] How to hide hotbar?

Started by SadDuck on

Topic category: Help with modding (Java Edition)

Last seen on 06:45, 12. Aug 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[SOLVED] How to hide hotbar?
Sun, 08/11/2024 - 08:29 (edited)

My overlay always appears under the hotbar. Is there any way to hide the hotbar? The only tutorial on the forum seems to have invalid.

Edited by SadDuck on Sun, 08/11/2024 - 08:29
Last seen on 06:45, 12. Aug 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
import net.minecraftforge…
Sun, 08/11/2024 - 08:43
import net.minecraftforge.client.event.RenderGuiOverlayEvent;
import net.minecraftforge.client.gui.overlay.VanillaGuiOverlay;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(modid = "YOURMODID", bus = Mod.EventBusSubscriber.Bus.FORGE)
public class FILENAME {
@SubscribeEvent
public static void hideHotbar(RenderGuiOverlayEvent.Pre event) {
if (event.getOverlay() == VanillaGuiOverlay.HOTBAR.type()) {
event.setCanceled(true);
}
}
}

Just enter the following code in the custom element to hide the hotbar. (Change 'FILE NAME' to your file name,Change 'YOURMODID' to your mod ID)