Data command doesn't remove leash from a mob
By adding a lead to a mob (with item or with command) a leash appears.
What I expected to happen was...:
By removing the leash with data, The leash is removed
What actually happened was...:
But when I remove it with the following command the leash is always here (in data of the entity and visually)
Steps to Reproduce:
add the leash (or with item):
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUID set from entity @p[distance=..40] UUID
remove the leash:
execute as @e[type=!player,distance=..10] run data remove entity @s Leash
Update 1.16: the UUID system has changed in 1.16
Linked Issues
relates to6
Created Issue:
Data command remove leash from a mob but still here visually
By adding a lead to a mob (with item or with command) a leash appears but when i remove it with the following command it is always here
add the leash:
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUIDLeast set from entity @p[distance=..40] UUIDLeast execute as @e[type=!player] at @s run data modify entity @s Leash.UUIDMost set from entity @p[distance=..40] UUIDMostremove the leash:
execute as @e[type=!player] run data modify entity @s Leash set value {}Then if I have to go to 100 blocks or to reload the world to update the leash (the mob is not affected, it's free by removing the leash)
By adding a lead to a mob (with item or with command) a leash appears but when i remove it with the following command it is always here
add the leash:
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUIDLeast set from entity @p[distance=..40] UUIDLeast execute as @e[type=!player] at @s run data modify entity @s Leash.UUIDMost set from entity @p[distance=..40] UUIDMostremove the leash:
execute as @e[type=!player] run data modify entity @s Leash set value {}Then if I have to go to 100 blocks or to reload the world to update the leash (the mob is not affected, it's free by removing the leash)
Moreover I can right click on a mob which has a visual leash
By adding a lead to a mob (with item or with command) a leash appears
but when i remove it with the following command it is always hereadd the leash:
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUIDLeast set from entity @p[distance=..40] UUIDLeast execute as @e[type=!player] at @s run data modify entity @s Leash.UUIDMost set from entity @p[distance=..40] UUIDMostremove the leash:
execute as @e[type=!player] run data modify entity @s Leash set value {}Then if I have to go to 100 blocks or to reload the world to update the leash (the mob is not affected, it's free by removing the leash)
Moreover I can right click on a mob which has a visual leashBy adding a lead to a mob (with item or with command) a leash appears.
What I expected to happen was...:
By removing the leash with data, The leash is removed
What actually happened was...:
But when I remove it with the following command the leash is always here (in data of the entity and visually)Steps to Reproduce:
add the leash (or with item):
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUID set from entity @p[distance=..40] UUID
remove the leash:
execute as @e[type=!player,distance=..10] run data modify entity @s Leash set value {}
Update 1.16: the UUID system has changed in 1.16
Data command remove leash from a mobbut still here visuallyData command doesn't remove leash from a mob
By adding a lead to a mob (with item or with command) a leash appears.
What I expected to happen was...:
By removing the leash with data, The leash is removed
What actually happened was...:
But when I remove it with the following command the leash is always here (in data of the entity and visually)Steps to Reproduce:
add the leash (or with item):
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUID set from entity @p[distance=..40] UUID
remove the leash:
execute as @e[type=!player,distance=..10] run datamodifyentity @s Leashset value {}
Update 1.16: the UUID system has changed in 1.16
By adding a lead to a mob (with item or with command) a leash appears.
What I expected to happen was...:
By removing the leash with data, The leash is removed
What actually happened was...:
But when I remove it with the following command the leash is always here (in data of the entity and visually)Steps to Reproduce:
add the leash (or with item):
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUID set from entity @p[distance=..40] UUID
remove the leash:
execute as @e[type=!player,distance=..10] run data remove entity @s Leash
Update 1.16: the UUID system has changed in 1.16
Data command doesn't remove leash from a mobData command does not behave properly when modifying or removing tag
By adding a lead to a mob (with item or with command) a leash appears.
What I expected to happen was...:
By removing the leash with data, The leash is removed
What actually happened was...:
But when I remove it with the following command the leash is always here (in data of the entity and visually)
Steps to Reproduce:
add the leash (or with item):
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUID set from entity @p[distance=..40] UUID
remove the leash:
execute as @e[type=!player,distance=..10] run data remove entity @s Leash
Update 1.16: the UUID system has changed in 1.16
By adding a lead to a mob (with item or with command) a leash appears.
What I expected to happen was...:
By removing the leash with data, The leash is removed
What actually happened was...:
But when I remove it with the following command the leash is always here (in data of the entity and visually)What is affected:
- Removing leash (adding a lead works)
- Editing an entity's inventory (removing or modifying an item)
Steps to Reproduce:
add the leash (or with item):
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUID set from entity @p[distance=..40] UUID
remove the leash:
execute as @e[type=!player,distance=..10] run data remove entity @s Leash
Update 1.16: the UUID system has changed in 1.16
By adding a lead to a mob (with item or with command) a leash appears.
What I expected to happen was...:
By removing the leash with data, The leash is removed
What actually happened was...:
But when I remove it with the following command the leash is always here (in data of the entity and visually)What is affected:
- Removing leash (adding a lead works)
- Editing an entity's inventory (removing or modifying an item)
Steps to Reproduce:
![]()
add the leash(or with item):execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUID set from entity @p[distance=..40] UUID
![]()
remove the leash:execute as @e[type=!player,distance=..10] run data remove entity @s Leash
Update 1.16: the UUID system has changed in 1.16
By adding a lead to a mob (with item or with command) a leash appears.
What I expected to happen was...:
The data command can be used to modify or remove tags of entities, or at least returns an error
For instance, by removing a leash with /data remove ..., the leash is removedWhat actually happened was...:
The data command returns "Modified entity data of ..." but didn't behave properly
If I remove the leash with the following command, nothing changesWhat is affected:
- Removing leash (adding a lead works)
- Editing an entity's inventory (removing or modifying an item, and can duplicate items for no reason)
Steps to Reproduce:
Add the leash to an entity (with command or with item):
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUID set from entity @p[distance=..40] UUID
Remove the leash (nothing changes):
execute as @e[type=!player,distance=..10] run data remove entity @s Leash
Summoning a villager with 7 potatoes and adding 2 stones to its inventory
summon villager ~ ~ ~ {Inventory:[{id:"minecraft:potato",Count:7b}],NoAI:1b} data merge entity @e[type=villager,limit=1,sort=nearest] {Inventory:[{id:"minecraft:stone",Count:2b}]} data get entity @e[type=villager,limit=1,sort=nearest] Inventory
modifying the count of an item (the count is increased, but the other items are duplicated):
data modify entity @e[type=villager,limit=1,sort=nearest] Inventory[0].Count set value 1b data get entity @e[type=villager,limit=1,sort=nearest] InventoryUpdate 1.16: the UUID system has changed in 1.16
By adding a lead to a mob (with item or with command) a leash appears.
What I expected to happen was...:
The data command can be used to modify or remove tags of entities, or at least returns an error
For instance, by removing a leash with /data remove ..., the leash is removedWhat actually happened was...:
The data command returns "Modified entity data of ..." but didn't behave properly
If I remove the leash with the following command, nothing changes
What is affected:
- Removing leash (adding a lead works)
- Editing an entity's inventory (removing or modifying an item, and can duplicate items for no reason)
Steps to Reproduce:
Add the leash to an entity (with command or with item):
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUID set from entity @p[distance=..40] UUID
Remove the leash (nothing changes):
execute as @e[type=!player,distance=..10] run data remove entity @s Leash
Summoning a villager with 7 potatoes and adding 2 stones to its inventory
summon villager ~ ~ ~ {Inventory:[{id:"minecraft:potato",Count:7b}],NoAI:1b} data merge entity @e[type=villager,limit=1,sort=nearest] {Inventory:[{id:"minecraft:stone",Count:2b}]} data get entity @e[type=villager,limit=1,sort=nearest] Inventory
modifying the count of an item (the count is increased, but the other items are duplicated):
data modify entity@e[type=villager,limit=1,sort=nearest] Inventory[0].Count set value 1b data get entity @e[type=villager,limit=1,sort=nearest] InventoryUpdate 1.16: the UUID system has changed in 1.16
By adding a lead to a mob (with item or with command) a leash appears.
What I expected to happen was...:
By removing the leash with data, The leash is removed
What actually happened was...:
But when I remove it with the following command the leash is always here (in data of the entity and visually)Steps to Reproduce:
add the leash (or with item):
execute as @e[type=!player,distance=..10] at @s run data modify entity @s Leash.UUID set from entity @p[distance=..40] UUID
remove the leash:
execute as @e[type=!player,distance=..10] run data remove entity @s LeashUpdate 1.16: the UUID system has changed in 1.16
Data command doesnot behave properly when modifying or removing tagData command doesn't remove leash from a mob
relates to
relates to
relates to
What I expected to happen was...:
By modifying the leash with /data modify on an entity without leash, no lead drops.
What actually happened was...:
When I modify the leash with the following command, a lead is always dropped (from mobs)
Steps to Reproduce:
As MC-179815 remove the leash with:
execute as @e[type=!player,distance=..40] run data modify entity @s Leash set value {}
This can be solved with MC-179817
As far as I can tell, ``/data remove`` does not work.
There are a slew of bug reports about it not working for specific things, such as
In fact, I have yet to find anything on which the command actually does work, though I'm sure there are some somewhere – you must have unit tests that work at some level.
What I suspect is that the pattern of these bugs not been noticed as a general problem, just as a bunch of individual, low priority issues.
What I expect is that either remove works, or it is removed from the doc as not really part of the command if you're not going to fix it.

Can confirm in 20w51a.
I apologize for the edit spam, the formatting keeps getting messed up by all the brackets.
Can confirm in 1.18.1 and 1.18.2-pre3. This seems to be a larger issue with the /data command, I cannot remove data tags or replace them at all, and sometimes it copies tags or changes unrelated tags in unexpected ways. I suggest renaming the ticket to "/data command does not behave properly when modifying or removing tags".
I summoned a villager using the command /summon villager ~ ~ ~ {Inventory:[
{id:"minecraft:potato",Count:7b}],NoAI:1}, and tried modifying its entity data using several commands. After each one, I checked its data using the command /data get entity @e[type=villager,limit=1,sort=nearest] Inventory. Here are my results:
Replacing the Inventory array with an empty array: /data modify entity @e[type=villager,limit=1,sort=nearest] Inventory set value [] (Villager has the following entity data: [\{id:"minecraft:potato",Count:7b}], No change)
Removing the first item in the Inventory array: /data remove entity @e[type=villager,limit=1,sort=nearest] Inventory[0] (Villager has the following entity data: [\{id:"minecraft:potato",Count:7b}], No change)
Removing the Inventory tag: /data remove entity @e[type=villager,limit=1,sort=nearest] Inventory (Villager has the following entity data: [\{id:"minecraft:potato",Count:7b}], No change)
Replacing the id of the item with wheat seeds: /data modify entity @e[type=villager,limit=1,sort=nearest] Inventory[0].id set value "minecraft:wheat_seeds" (Villager has the following entity data: [\{id:"minecraft:potato",Count:7b},\{id:"minecraft:wheat_seeds",Count:7b}]), Somehow duplicated the first array item with a changed id instead)
Changing the Count of the first item to 1b: /data modify entity @e[type=villager,limit=1,sort=nearest] Inventory[0].Count set value 1b (Villager has the following entity data: [\{id:"minecraft:potato",Count:8b},\{id:"minecraft:wheat_seeds",Count:14b}]), Somehow the Count of both array items changed by random amounts)
Please revert your changes to make this report only about leads again. The issue with villager inventories has already been addressed in
MC-112826Until this gets fixed, you can leash the wanted mob to itself and it will act as a non-leashed mob in every way except dropping the lead on death.
Command:
/execute as <entity> run data modify entity @s Leash.UUID set from entity @s UUID
Can confirm for 1.19.2.
Relates to
MC-128225, MC-153392,MC-122008,MC-207605, MC-135044,MC-138100,MC-248264.Can confirm for 1.19.4.
Until this is fixed, another possible solution is to set the Leash UUID to a faraway entity (in a forceloaded chunk, for example) which will automatically break the Lead.