Posted June 24, 20169 yr I’m constructing a MOD that implements MyBlock extends net.minecraft.block.Block and an associated MyTileEntity extends net.minecraft.tileentity.TileEntity that should open MyGuiScreen extends net.minecraft.client.gui.GuiScreen when the Minecraft Server decides to. The client side will ask the server to open MyGuiScreen and the Server will open it, after taking security concerns into account. Currently I have MyGuiScreen opening just fine when the client decides to, like this if (worldIn.isRemote) playerIn.openGui(MyMod.INSTANCE, MyGuiHandler.GUI_ID, worldIn, x, y, z) How do I allow the server to open MyGuiScreen at the client after the server receives a request from the client to do so? A software engineer’s job is often to condense fact from the nuance of vapor.
June 24, 20169 yr If you call EntityPlayer#openGUI on the server and your IGuiHandler#getServerGuiElement method returns a Container , FML will send a packet to the client telling it to open the same GUI (via your IGuiHandler ). If the open request needs to be sent from the client side (e.g. in response to a key press), send a custom packet to the server. The same applies if your GUI doesn't have a Container and you need to send the response packet manually. Forge's documentation explains networking in Minecraft here. This includes the Simple Network Implementation, which you should use to send the packet. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
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.