So I am designing a wizard class that creates constructs. In order to make it multiplayer friendly, I am trying to make it so that the construct (which is usually some entity like an armor stand or zombie) has the UUID tag of the player in its data. I am aware that it is impossible for two entities to have the same UUIDs, so I am trying to take the player's UUIDs and add it into the tags of the construct.
The command I am using is:
/data modify entity @e[type=armor_stand,limit=1] Tags[0] set from entity @p UUIDLeast
/data modify entity @e[type=armor_stand,limit=1] Tags[1] set from entity @p UUIDMost
My end goal is to have it so that the armor stand has a tags that are a numbers equal to the UUIDLeast/UUIDMost of the player who summoned it.
So I am designing a wizard class that creates constructs. In order to make it multiplayer friendly, I am trying to make it so that the construct (which is usually some entity like an armor stand or zombie) has the UUID tag of the player in its data. I am aware that it is impossible for two entities to have the same UUIDs, so I am trying to take the player's UUIDs and add it into the tags of the construct.
The command I am using is:
/data modify entity @e[type=armor_stand,limit=1] Tags[0] set from entity @p UUIDLeast
/data modify entity @e[type=armor_stand,limit=1] Tags[1] set from entity @p UUIDMost
My end goal is to have it so that the armor stand has a tags that are a numbers equal to the UUIDLeast/UUIDMost of the player who summoned it.
Thank you for the help!
Tags is an array of strings which holds scoreboard tags. To achieve what you want, you need a custom tag. Now since you cannot add a custom tag to the entity directly, you have to use an item in the entities inventory or in this case, the armor/hand slots.
Background:
So I am designing a wizard class that creates constructs. In order to make it multiplayer friendly, I am trying to make it so that the construct (which is usually some entity like an armor stand or zombie) has the UUID tag of the player in its data. I am aware that it is impossible for two entities to have the same UUIDs, so I am trying to take the player's UUIDs and add it into the tags of the construct.
The command I am using is:
/data modify entity @e[type=armor_stand,limit=1] Tags[0] set from entity @p UUIDLeast
/data modify entity @e[type=armor_stand,limit=1] Tags[1] set from entity @p UUIDMost
My end goal is to have it so that the armor stand has a tags that are a numbers equal to the UUIDLeast/UUIDMost of the player who summoned it.
Thank you for the help!
The Big Dog
Tags is an array of strings which holds scoreboard tags. To achieve what you want, you need a custom tag. Now since you cannot add a custom tag to the entity directly, you have to use an item in the entities inventory or in this case, the armor/hand slots.
now you can execute this command to store the numbers:
Some of my projects:
https://www.curseforge.com/members/megacrafter1077/projects
https://datapackcenter.com/projects/adventure.104/
My tutorials:
https://datapackcenter.com/projects/data-pack-basics.71/
https://datapackcenter.com/projects/loot-tables.72/
https://datapackcenter.com/projects/custom-crafting-tutorial.70/
https://datapackcenter.com/projects/custom-item-models-tutorial.69/
https://datapackcenter.com/projects/raycasting-tutorial.68/