package com.example; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; @Mod(modid = "examplemod", useMetadata = true) public class ExampleMod { @Mod.EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(this); ClientCommandHandler.instance.registerCommand(new CrashCommand()); } public static GuiScreen screenToOpenNextTick = null; public static final int MOUSE_LEFT = 0; public static final int MOUSE_RIGHT = 1; public static final int MOUSE_MIDDLE = 2; public static final int MOUSE_BACKWARD = 3; public static final int MOUSE_FORWARD = 4; @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { if (screenToOpenNextTick != null) { Minecraft.getMinecraft().displayGuiScreen(screenToOpenNextTick); screenToOpenNextTick = null; } } }