Posted May 4, 201411 yr i'm making a block that has a gui with buttons and when i press 1 button i want it to check a few blocks and change them. now i know how to write the code to check the blocks, and how to change them. the problem i have is that i only know how to do that from inside another block, not from inside a gui, since in the gui i can't find how to ask for the coordinates of the block that has the gui. so either i need a way for my gui to call a method inside the block, or a way to acces the gui block his coordinates, including what world it is in and just for the record, i have already made a button within the gui, and i know what gui method is called when the button is pressed, so that's no problem
May 5, 201411 yr Do you use a GUI handler to return the instance of the GUI? If yes, I think your GUI is returned in the method "getClientGuiElement", so you could just add in the constructor of your GUI, three int parameters that represents the x, y and z coordinates, and when you have to instantiate your GUI you can simply pass the coords to it.
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.