Mark136 Posted December 23, 2016 Posted December 23, 2016 hallo, I currently stuck at replacing the player's inventory with my custom one, I have googled much for a solution for this, but cannot find anything that would help me I've already tried this: @SubscribeEvent public void PlayerContainerEvent(net.minecraftforge.event.entity.player.PlayerContainerEvent e){ Container container = e.getContainer(); EntityPlayer player = e.getEntityPlayer() if(container == player.inventoryContainer && !player.isCreative()){ //also true when my custom gui is opened ? and yeah, i wish to keep creative inventory System.out.println("do some stuff like opening my own gui & container"); } but somewhere if i open my Gui, the booleancontainer == player.inventoryContainer is also true, so this hasn't worked for me. does someone know something better then this ore something to fix my problem. Quote my Mod: Extended RPG [W.I.P]
Jay Avery Posted December 23, 2016 Posted December 23, 2016 You want GuiOpenEvent - then you can check whether the event's GUI is the inventory, and set it to your custom GUI instead. Quote
Mark136 Posted December 24, 2016 Author Posted December 24, 2016 ah, thanks, never knew that there was an event called GuiOpenEvent I only had looked in the event Map of minecraft forge but forgot there were also Client events everything is working fine now Quote my Mod: Extended RPG [W.I.P]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.