PARTICIPANT IN A UNRANKED completed JAM
data packs best

  • Functions
  • 1,191 views • 4 today
  • 133 downloads • 0 today
  • 10
  • 10
  • 16
Required Resource Pack
MASTERGHOST
Level 20 : Expert Engineer Explorer
11
Want to add a UI to your datapack/world? Make an autoclicker game? (I will make one using this datapack :) )
Then this datapack is the right answer for you!




!This datapack is designed for datapack, map, and server creators who have experience with Minecraft commands!
If you want to create a UI without using commands, leave a comment here or on my profile and I’ll make another datapack for it




  • The chest minecart (and others) are invisible and do not affect your world’s minecarts
  • Comes with examples that can already be tested in your world
  • The datapack is fully commented for the curious
  • Will get regular updates (including bug fixes if you find any)
  • multiplayer compatible
  • optimized
  • Always include information about modifications to previous UI projects in the updates



Read (more detailed): geral_info.md


UPDATES [​1.1.2]
(Old updates are listed in geral_info.md)


- updated geral_info.md for better clarity
- Removed minecraft/tags/entity
- Optimized and easier to use (now uses storage instead of entity NBT)
- Now the item only requires custom_data={ui:1}
- Removed [​OLD_METHOD] and [​NEW_METHOD] from functions.md
- Updated comments
- If the player loses the UI item, the tag @p remove menu is automatically removed
- added 'ui_init.mcfunction' function (runs only once when the player first opens the UI)
- In the resource pack, all .json files were converted to a single line to save space (only the invisible minecart part)
- Optimized detection of player logout using the UI and closing it
- Added an extra safety to the change function '@p[​tag=menu]'
- Portuguese content removed, English content corrected
- Better examples:
  - Removed old examples (except the crafting table and player stats)
  - added shop, vote system for map, rewards, and inventory

EASY VIEW
If a new player joins: - Create chest_minecart (and ID)
- Call <load function> NEW
If the player is using the [​UI] item: - Teleport that specific chest_minecart
Detect changes in the UI and call: - <user functions> - And reload the UI
If the player stops using the [​UI] item: - Call <stop function> - Teleport the [​UI] to 0 -64 0 (so it cannot be used and stays stored)

<page (UI)> - Your custom UI
<user functions> - Detect if an item was removed - Detect if an item was added - If it is a UI decoration (no function), the page reloads automatically - Can change to another UI
<stop function> - Extra operations when that specific page is closed

NEW
<load function>
- Any additional code for first-time joining players
- Load the main <page (UI)>

CompatibilityMinecraft 1.21
Tags

4 Update Logs

bug fix : by MASTERGHOST 03/06/2026 4:35:29 pmMarch 6 @ 9:35 pm UTC

Added a system in the "inventory" example that returns the item with 'ui:1' if the player has placed it inside.
LOAD MORE LOGS

  Have something to say?

BoBanBoa
03/02/2026 5:12 am
Level 1 : New Miner
and how can I use it please help ;-;
how to make an UI
2
MASTERGHOST
03/02/2026 5:28 pm
He/Him • Level 20 : Expert Engineer Explorer
I’m so used to datapacks (I’m also familiar with programming in C++ and Assembly) that it seems obvious to me, but most people probably don’t even know how to use storage.


Anyway, I wanted to discuss with you how I can make this easier to use without hurting performance, while still giving as much freedom as possible to those who understand it.
1
MASTERGHOST
03/02/2026 5:19 pm
He/Him • Level 20 : Expert Engineer Explorer
history
The goal (which I will clearly explain in the description) is for you to edit this datapack and apply it to your own map (for map or datapack creators).

If you're not very familiar with datapacks and want something simpler, I will try in the future to create a separate version that doesn’t require editing. For example, you would just place items inside a chest and it would automatically turn into a UI (I still need to figure out exactly how I’ll implement that).


If you do know about datapacks and your intention is to edit it but you’re not sure how:

After installing, simply move this datapack into your world’s 'datapacks' folder (you can also just add it and test it first to see if you like it).
If you decide to use it:

I recommend using Visual Studio Code, which is basically a more optimized and organized text editor (you can also install extensions to help detect command errors and provide syntax highlighting).

Open the datapack folder (using Visual Studio Code or a regular text editor), then open geral_info.mdwhich provides general information.

To view the functions and learn how to edit them, go to:
data/examples/function/functions.mdThis file explains how everything works and how to modify it.



You can check how the examples were made. I separated them into the "Examples" folder, each folder represents one UI.

Inside each folder, I included:
UI (named 'initial_page.mcfunction') - this contains the items that appear on the page.

A function that is called when you click, take, remove, or change something in the chest:change.mcfunction
In that file (example below), you can see which item was removed. For example:
execute unless ui current[{Slot:0b}] run ...This command only executes when there is no item in slot 0 of the chest - meaning the item was removed


It’s nothing more than a function, so you can put whatever you want in there.
I admit I added some advanced stuff (but it can be ignored). It’s just there to show that everything is possible.

The part below is used to change the name of the sign (by adding the player’s MONEY and XP). It’s basically meant to be a player stats sign.

But for basic things, you can still do pretty much anything.
For example, if you want to remove an item and switch to another UI, you just need to call the function you created that defines the new UI.

UI:



You might think it’s complex because it looks big:
["minecraft:custom_model_data":{floats:[1]},"minecraft:item_name":"","minecraft:custom_data":{ui_item:{}}]



"minecraft:custom_model_data":{floats:[1]} it’s only there to show that you can add custom textures to your UI. (can be removed)


"minecraft:item_name":"" is used to prevent the name "Barrier" from being displayed.

"minecraft:custom_data":{ui_item:{}}is used to indicate that the item is part of the UI only (it should not be removed),

My datapack detects this tag, and if the player tries to take, drop, etc., the item will be removed automatically (since it’s only decorative). If the tag is not present, it means the item is meant to be collected by the player.

Slot and id are normal chest properties:
id:"stone" the item you want to place.


Slot:0bthe slot where you want to place it (it starts at 0, not 1). The 'b' simply means byte - Minecraft requires it for this value.

The rest below consists of functions explained in:
data/examples/function/functions.mdFor example, this is where you can learn how to change the UI name, icon, etc.




------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


To summarize:
(I highly recommend using Visual Studio Code)


Go to geral_info.md and read the section called "TO EDIT THIS DATAPACK".

and at:
data/examples/function/functions.md
PAGE FUNCTION → Everything related to the UI (the items that appear in the chest).

COMPARE FUNCTION → Everything related to the comparison function. As the name suggests, it checks which item was removed or taken and decides which function to run when that happens.

CLOSE FUNCTION → This was an extra feature I added (it was requested). If the player closes the UI on a specific page, it runs a specific function (it’s not mandatory to use).



Ignore:data\ui there’s no need to change anything there unless you’re curious about how it works internally (I’ve commented everything).

All examples are fully commented. If you have any questions, let me know, and if necessary, I can make a video (the only problem is that I can write English, but I’m not very confident speaking it)
1
MASTERGHOST
03/02/2026 5:25 pm
He/Him • Level 20 : Expert Engineer Explorer
Also I created an EASY VIEW:

If a new player joins: - Create chest_minecart (and ID)
- Call <load function> NEW
If the player is using the [​UI] item: - Teleport that specific chest_minecart
Detect changes in the UI and call: - <user functions> - And reload the UI
If the player stops using the [​UI] item: - Call <stop function> - Teleport the [​UI] to 0 -64 0 (so it cannot be used and stays stored)

<page (UI)> - Your custom UI
<user functions> - Detect if an item was removed - Detect if an item was added - If it is a UI decoration (no function), the page reloads automatically - Can change to another UI
<stop function> - Extra operations when that specific page is closed

NEW
<load function>
- Any additional code for first-time joining players
- Load the main <page (UI)>



Of course, to know how to use it, check data\examples\function\functions.mdor you can just figure it out by looking at the examples.
1
BoBanBoa
03/03/2026 1:20 am
Level 1 : New Miner
oh no problem I figure it out xD
1
BoBanBoa
03/03/2026 1:10 am
Level 1 : New Miner
I opened it in VScode and it show some weird character and then I go for Notepad to check if its okay but it still show same weird code:/
1
BoBanBoa
03/03/2026 1:03 am
Level 1 : New Miner
it also say "The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding." in Visual Studio Code, so how can I fix this ;-;
1
MASTERGHOST
03/04/2026 11:48 am
He/Him • Level 20 : Expert Engineer Explorer
uh Did you unzip it? Because what you downloaded is a .zip file, not a folder
1
BoBanBoa
03/03/2026 12:47 am
Level 1 : New Miner
thank for your help it's very useful
1
BoBanBoa
03/03/2026 12:56 am
Level 1 : New Miner
and does it usable for aternos server?
1

Welcome