Topic category: Troubleshooting, bugs, and solutions
Not sure if it's a bug or a design decision, but the x/y/z parameters sent to "When this GUI is opened" and "While this GUI is opened tick" for block-linked GUI are different:
- "When this GUI is opened" receives the position of the originating block via FriendlyByteBuf. This behavior is consistent whether the GUI is opened via the "Open GUI" procedure command or via the auto-generated useWithoutItem method override created when "Open bound GUI on right click" is enabled.
- "While this GUI is opened tick" receives the player position instead, taken from PlayerTickEvent.Post in the GUI's onPlayerTick override.
Just lost a few hours to this - if it's by design, it may deserve a mention in the wiki's "GUI Editor" page. I was trying to update a block's data from a client-side checkbox, but was in fact setting up a property on the player instead since I was doing the change in the tick procedure.