Topic category: User side tutorials
Hi. I want to share with you the way I made custom GUI tabs in my Worm Industries mod. There is no custom coding, just vanilla MCreator procedures. Originally I made it in MCreator 2020.5 but this tutorial was made in 2021.1.
The principle is very simple. You have several GUIs and clicking the button switch between them.
1. Create the block/item you want to bound the GUI to.
2. Design your custom GUI.
I created a GUI where I want to use 3 tabs (Soup, Bell and Clock). I added pictures and buttons. This is your template GUI you will work with.
The "tab area" on the left side is just a custom picture.
I set it as the main GUI for my block so when I right click the block, this GUI opens.
3. Create your "tab" GUIs.
For each tab create its own GUI. To keep the same layout just duplicate the main (template) GUI and modify it.
I created three tab GUIs (Soup, Bell and Clock). Changed the text field in the top and added a picture in the midle. But you can add/remove whatever you want.
Also I changed the pictures in the tab area to black and white variants. Only the one that refers to actual open tab is coloured.
The easiest way to change a picture for another one is to double-click it and from the pop-up menu you choose different one.
4. Make switching procedures.
For each tab button you have to make its own procedure. But it's very simple. Just choose from Player procedure blocks "Open screen for entity..." Then select the GUI you want to open.
Here I want to open Soup GUI after Soup Button clicking.
5. Connect the procedures to the buttons.
Now connect the procedures you made with the right buttons in each GUI. Here I'll connect SoupButton procedure to each button "Soup" in my GUIs. Then I'll continue with connecting BellButton procedure to Bell button, etc.
Leave the button procedure empty if the button you press opens the tab you currently are in. For example I'm in the Bell tab and I click Bell button. Nothing happens because it is useless to open a GUI I'm in again.
In the end I have got 8 mod elements:
Now if you connected everything correctly you can see the result in the game. :)
Thank you so much for this. This has made my traders/gui much more interesting.
Thank you, this was helpful!
If anyone is curious, to make proper inventory tabs the way they look in creative mode, you can use the image button tutorial found here https://mcreator.net/forum/83507/added-image-buttons-guis.
@Rikurob Thank you for sharing it! I thought I hallucinated this tutorial when I couldn't find it again haha
No problem, that tutorial taught me so much about actually coding the GUIs when I was playing around with the files, its one of my personal favorites.