Inconsistency in /data syntax for components
Reference: MC-268833
Expected behaviour:
You should be able to use the same data path for '/data get' and '/data modify' at all times.
What happens instead:
When modifying a component on an item with '/data modify', you can use the component name without the "minecraft:" part, but only if that component is not already present. If it is already present, or if you're using /data get, this will not work.
How to reproduce:
- Put a sword in a chest and run the following command:
- /data modify block x y z Items[0].components.enchantments.levels."minecraft:sharpness" set value 1
- => Notice how this worked, despite using enchantments instead of "minecraft:enchantments"
- Try the data modification again, this time with sharpness 2
- => Notice how this didn't work, as it now requires "minecraft:enchantments"
- Also try the following command
- /data get block x y z Items[0].components.enchantments.levels."minecraft:sharpness"
- => Notice how this also doesn't work
2024-03-23, 04:25 PM
2024-03-24, 03:40 AM
2024-03-24, 03:40 AM
0
0
-