Posted September 1, 201213 yr I want a gui I've created to open when a block I've made is right clicked(onBlockActivated), but I can't find any suitable methods. The openGui method in the EntityPlayer class requires a gui id, but I have no idea what that is. I've looked at the methods the vanilla gui's use, but they require a minecraft instance that I don't know how to create. Does anyone know how to open a new gui in Forge?
September 1, 201213 yr There are many tutorials out there for this. As for the id, its w/e the hell you set, I recomend something logical like 1 for your first gui, 2 for the 2nd and so forth... I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
September 1, 201213 yr It doesn't "require" an ID if you only have one gui. I think you just have to make sure you set up your GuiHandler correctly and the it will be fine.
September 1, 201213 yr Author I think I've figured it out, but when I right click on my block to open a Gui, the command window says "[WARNING] [ForgeModLoader] A mod tried to open a gui on the server without being a NetworkMod" and the gui fails to open. I have the "Mod", "NetworkMod", and "SidedProxy" annotations set up according to the google doc on the first block tutorial page on forge wiki, and I set up the GuiHandler (implementing IGuiHandler and overriding the methods) according to the Containers and Gui tutorial on the wiki. My mod works fine otherwise (the blocks and items I created work correctly) How can I make my mode a NetworkMod? I've searched for solutions, but I can't find any using google. Also, the command window says that my textures aren't preloading. How do I preload textures?
September 1, 201213 yr To remotely open a GUI (from a block in the world, for example) you need to be an @networkmod
September 1, 201213 yr Author I have this line of code right above my main mod class (I have a PacketHandler set up): @NetworkMod(channels = { "Custom Music" }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) Do I need to do something more to get this to work?
September 2, 201213 yr Author I've had that there all along, and it still wasn't working. I don't know what else I can do. It still says that my mod isn't a networkmod. Also, the mcp recompiler is using the 1.6 source rather than the 7 source, so I can't use strings in switches. How can I change which source the mcp recomplier uses?
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.