Get associated block of currently open GUI?

Started by EnderSam on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Get associated block of currently open GUI?

Hello! I just want to know, is there a way to get the associated block or the X Y Z coords of said block of the currently open GUI?

Like, for example, say I have a GUI "CustomFurnaceGUI" attached to a block called "CustomFurnace"

Through procedures attached to the GUI procedure triggers, like "While this GUI is open tick", is there a way to get the "CustomFurnace" Block of the GUI that is currently open?

The X Y Z dependancies that come with the GUI procedure triggers are the X Y Z values of the player, and not the block associated with the currently open GUI, and I want the associated block in order to get and set properties, place blocks based on the open GUI block's coords and not the player's, etc.

Like if the "CustomFurnace" block had the boolean property "lit" which would change the block texture based on the value of the property, I want to know if there is a way to get or set the property of the specific "CustomFurnace" block that the currently open GUI is attached to

Hopefully this is understandable

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Currently having this exact…
Fri, 01/24/2025 - 19:57

Currently having this exact thing lol. Did you figure it out?

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi, I think I've found…
Sun, 02/02/2025 - 21:48

Hi, I think I've found something that may help you.

I've been trying to create a lifetime variable for x and z that has the coordinates of the specific block. You can create a special procedure that stores the x and z of the block in the previously created lifetime variables and call this procedure when the player right-clicks on the block.
This is in the block's triggers.

I don't know if I've expressed myself correctly.

Translated with DeepL.com (free version)