Minecraft Data Packs / Other

GUI API 1.20.4 Datapack

  • check_circle Functions
  • 709 views, 7 today
  • 66 downloads, 0 today
  • 2
  • 3
Bisai's Avatar Bisai
Level 12 : Journeyman Collective
0
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:

/function header:api/gui/setup/create

2. Renaming the GUI

To rename the newly created GUI, use the following command:


/function header:api/gui/setup/rename


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:
/function header:api/gui/setup/set/type/chest

Chest Minecart:
/function header:api/gui/setup/set/type/chest_minecart

Ender Chest:
/function header:api/gui/setup/set/type/ender_chest

Hopper:
/function header:api/gui/setup/set/type/hopper

Hopper Minecart:
/function header:api/gui/setup/set/type/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:

/function header:api/gui/setup/set/homepage

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:
/data modify block (CHEST COORDINATES) Items[{Slot:0b}].tag.Action.GUI append value "say hi"

Execute command from the player:
/data modify block (CHEST COORDINATES) Items[{Slot:0b}].tag.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/page

7. Removing a Page

To remove a page from your GUI, execute this command:

/function header:api/gui/setup/remove/page

8. 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/page

9. Going to the Homepage

To return to the homepage of your GUI, use the following command:

/function header:api/gui/engine/go/homepage
10. 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/gui

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.
CompatibilityMinecraft 1.20
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome