Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.