• 9/17/24 12:33 pm
- 1.8k views • 3 today
- save_alt 51 downloads • 0 today
- Compatibility
- Minecraft 1.21
- Changes include
6
Guide to Creating a Custom GUI in Minecraft with the Custom GUI API Datapack
This guide will take you step-by-step through the process of creating a custom GUI in Minecraft using the Custom GUI API Datapack. Follow the instructions carefully to create and customize your own GUI.
1. Creating a New GUI
To create a new GUI, execute the following command:
2. Renaming the GUI
To rename the newly created GUI, use the following command:
3. Setting the GUI Type
You can choose from five different types for your GUI. Use the corresponding commands to set the desired type:
Chest:
Chest Minecart:
Ender Chest:
Hopper:
Hopper Minecart:
4. Setting the Homepage
To set the homepage for your GUI, execute the following command while standing on a chest with another chest underneath:
The upper chest represents the layout of your GUI.
The lower chest contains Action Items. Place these on the slots where you want an action to occur when clicked in the GUI.
5. Defining Actions for Items
There are two ways to execute commands when an item is clicked:
Execute command from the GUI (run this on the Action Item):
Execute command from the Player (run this on the Action Item):
6. Adding a New Page
To add a new page to your GUI, use the following command:
7. Removing a Page
To remove a page from your GUI, execute this command:
8. Switching Between Pages
To switch pages, set the new page value and execute the page switch:
9. Going to the Homepage
To return to the homepage of your GUI, use the following command:
10. Making the GUI Functional
To ensure your GUI functions properly, you need to execute the following function every tick for the GUI entity:
By following these steps, you have now created and customized a custom GUI in Minecraft. Enjoy creating and experimenting with your own GUI!
If you have Questions, feel free to contact me.
This guide will take you step-by-step through the process of creating a custom GUI in Minecraft using the Custom GUI API Datapack. Follow the instructions carefully to create and customize your own GUI.
1. Creating a New GUI
To create a new GUI, execute the following command:
/function header:api/gui/setup/create2. Renaming the GUI
To rename the newly created GUI, use the following command:
/function header:api/gui/setup/rename3. Setting the GUI Type
You can choose from five different types for your GUI. Use the corresponding commands to set the desired type:
Chest:
/function header:api/gui/setup/set/type/chestChest Minecart:
/function header:api/gui/setup/set/type/chest_minecartEnder Chest:
/function header:api/gui/setup/set/type/ender_chestHopper:
/function header:api/gui/setup/set/type/hopperHopper Minecart:
/function header:api/gui/setup/set/type/hopper_minecart4. Setting the Homepage
To set the homepage for your GUI, execute the following command while standing on a chest with another chest underneath:
/function header:api/gui/setup/set/homepageThe upper chest represents the layout of your GUI.
The lower chest contains Action Items. Place these on the slots where you want an action to occur when clicked in the GUI.
5. Defining Actions for Items
There are two ways to execute commands when an item is clicked:
Execute command from the GUI (run this on the Action Item):
/data modify block -104 74 56 Items[0].components.minecraft:custom_data.Action.GUI append value "say hi"Execute command from the Player (run this on the Action Item):
/data modify block -104 74 56 Items[0].components.minecraft:custom_data.Action.Player append value "say hi"6. Adding a New Page
To add a new page to your GUI, use the following command:
/function header:api/gui/setup/add/page7. Removing a Page
To remove a page from your GUI, execute this command:
/function header:api/gui/setup/remove/page8. Switching Between Pages
To switch pages, set the new page value and execute the page switch:
data modify storage database:temp api.gui.load_page set value {PAGE NAME}function header:api/gui/engine/go/page9. Going to the Homepage
To return to the homepage of your GUI, use the following command:
function header:api/gui/engine/go/homepage10. Making the GUI Functional
To ensure your GUI functions properly, you need to execute the following function every tick for the GUI entity:
function header:api/gui/engine/guiYou have to set the GUI ID in the Scoreboard in the Entityscoreboard players set (Entity) api.gui.ID 1By following these steps, you have now created and customized a custom GUI in Minecraft. Enjoy creating and experimenting with your own GUI!
If you have Questions, feel free to contact me.
6412795
119


Have something to say?