Jump to content

THEJean_Kevin

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by THEJean_Kevin

  1. Hello, I would like to cancel the opening of the GuiIngamePause menu according to a condition. But InputEvent.KeyInputEvent can't canceled. Mycode : @SubscribeEvent public void onKey(final InputEvent.KeyInputEvent event) { if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) { if(cancel){ //need to cancel } } }
  2. thx you so much the solution public GuiCreationStartup guiLogin; public boolean login = false; @SubscribeEvent public void onOpenGui(GuiOpenEvent event) { if(event.getGui() instanceof GuiCreationStartup) { this.guiLogin = (GuiCreationStartup) event.getGui(); } if(event.getGui() instanceof GuiIngameMenu && this.guiLogin != null) { this.login = true; } if(event.getGui() == null && this.login) { Minecraft.getMinecraft().displayGuiScreen(this.guiLogin); this.guiLogin = null; this.login = false; } }
  3. I don't understand how to detect when the gui is closed with GuiOpenEvent. I do this : public class ClientEventHandler { public GuiCreationStartup guiLogin = null; @SubscribeEvent public void onOpenGui(GuiOpenEvent event) { if(event.getGui() instanceof GuiCreationStartup) { this.guiLogin = (GuiCreationStartup) event.getGui(); } if(event.getGui() instanceof GuiIngameMenu && this.guiLogin != null) { //Need to detect IngameMenu close } } }
  4. How to detect if the GuiIngameMenu is closed and my GUI was open before?
  5. Hello, I created a GUI that the player has to complete when he logs in for the first time. I would like that when the player presses "escape", the pause menu appears but without removing my GUI. I have this to detect "escape" pressed @Override public void keyTyped(char c, int i) { if (i == 1) { } else { super.keyTyped(c, i); } }
  6. Hello, It's me again, I'm sorry for ask many help, but I start with forge. So I need to get LayerRenderer for check if it's instanceof to my LayerPlayer but I don't have acces to layerRenderers in this line "final List<? extends LayerRenderer> list = render.layerRenderers;". Eclipse sayed me "The field RenderLivingBase<AbstractClientPlayer>.layerRenderers is not visible". MyCode.java
  7. Ty for information, but do you have an exemple to use packet (I never used this before)
  8. I used IGuiHandler because I read EntityJoinWorldEvent it's a server event and GuiScreen it's only client (so it's for this reason I used player.openGui) This Gui show a menu for choose language. I would like to open this GUI when player join the server for the first time
  9. Hello, I would like to open a GuiScreen when the player login but currently the Gui doesn't open when the player connects EventHandler : (register with FMLCommonHandler.instance().bus().register(eventHandler);) GuiHandler : Gui :
  10. Thx you draco18s. I found the problem. I just forgot tout put @SubscribeEvent on registerBlock function in the main class. Thank you for your advice and for explaining some things to me
  11. I'm sry for the basic mistakes like name class. It's my first mod and I try to understand how it work. I just follow some tutorials but I don't understand why it don't work for me? I will change what do you sayed draco18s and I come back here if I have always this problem. Thank you for taking the time for me
  12. I don't have any errors in the console, but I think I made a mistake when I register the block but where? The full code : https://github.com/THEJean-Kevin/goblin
  13. Hello, I have a problem and I can't find the source. I would like to create a block with a model but in game, I don't have a texture on the block but I have the texture on the item in the inventory and thrown it on the floor. As in the picture My code
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.