Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-269810

Inconsistency in /data syntax for components

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 24w12a
    • None
    • Unconfirmed
    • (Unassigned)

      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

            Unassigned Unassigned
            SilicatYT SilicatYT
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: