Topic category: Help with Minecraft modding (Java Edition)
2023.1. Prototype GUI used to close current one and reopen other GUI to replicate effect of turning the page, but it looked very terrible, caused visual glitches and cursor teleported to center of screen each time new page was opened.
Now i wanted to pull all together into one GUI, with idea of making text and image displaying info corresponding to pressed button but i have no idea how to do this since:
A: Im either blind or stupid or both, but there's literally no procedrue blocks to display something in gui once you press the button, only to run some procedures outside it
B: I tried using return values and variables on button press but it doesn't work, displayed info either don't change or don't display at all.
https://imgur.com/a/kkGsJx1
So question is, is it possible at all, and if it is, then how to make it?
Thanks.
You can use a number variable that gets set to a different number when you click the button, acting as a "page" variable. This method requires that you make a return logic for every page that you want, and hook it up to every object in the gui, which would be tedious process and would look like a mess looking at the gui with all the text clashing with each other
But (and this is untested and i may be wrong), I do believe you can open a gui without it being closed. The reason why the cursor gets reset to the middle is simply because when the GUI gets closed, the game locks your cursor again to the middle (as is how minecraft is played). This solution is worth a try if you prioritize being able to read what's going on in the editor.
You will need to make the global variable in the player scope btw