Sign in to follow this
Followers
0
[1.7.10] entity.RotationPitch question
By
Frag, in Modder Support
-
Recently Browsing
No registered users viewing this page.
-
Posts
-
I did it, but I think it's only clientside prevention. I gotta send real packet "close gui" to trigger serverside InventoryCloseEvent (or something like that).
-
By diesieben07 · Posted
To prevent the GUI from opening in GuiOpenEvent you need to cancel the event. -
By diesieben07 · Posted
The only way to make data persist is to write to to some form of file. Whether you do it explicitly, or implicitly. You cannot persist data by wishing really hard. -
I am trying to write an Minecraft Forge (1.12.2) mod. It should work like that: OnGuiOpen: If GUI title is equals to constant string value then close GUI (like ESC). That must be known by the server exactly like closing a GUI by clicking E/ESC. My code (doesn't work - I'm seeing 'Turning off' in console but gui is still turned on) public class ModEventHandler { @SubscribeEvent public void onGuiOpen(GuiOpenEvent event) { if(event.getGui() instanceof GuiContainer) { checkGui((GuiContainer) event.getGui()); } } private void checkGui(GuiContainer gui) { if(gui.inventorySlots instanceof ContainerChest) { ContainerChest _gui = (ContainerChest)gui.inventorySlots; String text = _gui.getLowerChestInventory().getDisplayName().getUnformattedText().toString(); if(text.contains(" ")) { System.out.println("Turning off"); Minecraft.getMinecraft().player.closeScreen(); Minecraft.getMinecraft().displayGuiScreen(null); KeyBinding.onTick(Keyboard.KEY_ESCAPE); } } } } Thank u in advance for help
-
By Differentiation · Posted
The thing is I was trying to figure out if there's any way to accomplish this without having to save data to a file.
-
-
Topics
-
Who's Online (See full list)