Posted November 11, 20159 yr I'm trying to create a GUI for a TileEntity on Minecraft 1.8. Basically I want to be able to put in a single book that has been written in, otherwise open the book inside. I am stuck with the GUI allowing you to enter the book. However, I keep getting an Null Pointer Exception from the Slot class: http://pastebin.com/tDE1wAwP My code: Container: http://pastebin.com/9R5MrmG5 Gui: http://pastebin.com/YdCg8wtN Gui Handler: http://pastebin.com/tDwbBj41 Block: http://pastebin.com/UKtR0WtT Any ideas and help would be greatly appreciated!
November 11, 20159 yr If you could show me your tile entity class, i could help. Few things to notice: -You open gui, in onBlockActivated() without checking if its a client. The code will crash the server. -Why you open your gui inside your tile entity? I suggest you to route your gui opening throught your ClientProxy, it can slove your poblem. You can use: Minecraft.getMinecraft().displayGuiScreen(new Gui(player));
November 11, 20159 yr Author Figured it out with help from IRC, it was because my inventory was null in my TileEntity
November 11, 20159 yr Yeah okay, still watch out for side checking when you open your gui, because it can cause a crash when you fire up a server. Glad you figured it out!
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.