Published Apr 26th, 2025, 4/26/25 5:27 pm
- 510 views • 1 today
- 10 downloads • 0 today
39

Global ID is a Library to manage entity ID easly, this library was made originally as personal use but since the Yeggs Map Jam rules doesn't allow to use things prev made, im publishing it to everyone and also for future datapacks.
Usage:
Connect the function "globalid:load" to your own "#minecraft:load"
To make a new ID, you can use the function "globalid:internal/createid" or "globalid:internal/createidasentity".
The first function will create an ID without copying it to entity, you will need to use "globalid:internal/copyactualid", that function will copy to the entity that you're executing the newest ID. The second function makes all this automaticly
If you're working with various entities and them all needs the same id, run the previous function for the Parent (To create a new ID) and run the function "globalid:internal/copyactualid" for the Child entities
To use the ID system, do this:
tag @e[Your Entity] add checkID
function globalid:internal/checkentities
execute as @e[Your Entity,tag=hasID] run function foo:...
tag @e[tag=hasID] remove hasID
Add to your entities the tag "checkID", run the function "globalid:internal/checkentities" and use the tag "hasID" as your output, the library will make the commands to check if the ID matches
For copying IDs, the function "globalid:internal/copytempid" will copy the ID from another fake player. the usage is this:
scoreboard players operation #copy globalID = @s globalID
execute summon minecraft:pig run function foo:.../initiate> foo:.../initiatefunction globalid:internal/copytempidThis functions will spawn a new pig and copy the ID from the entity in which it is running this first function.
Thanks
That's all, this is a very small library but also its very useful for datapacks, if you want to use the library, it's all yours. Credit is not needed to use but i appreciate it.
| Credit | Minho - Making Obsidian, the Ancestor of Global ID |
| Compatibility | Minecraft 1.21 |
| Tags |
6601350
119



Have something to say?