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

Execute store on player only works if the item already has tags

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • None
    • Minecraft 1.14.1
    • None
    • Windows 10 Java edition
    • Unconfirmed

    Description

      Items that do not have tag:{} can not have data stored on them with execute store, the following command should store test:1b on the first item on my hotbar.

      /execute as @p store success entity @s Inventory[{Slot:0b}].tag.test byte 1 run gamerule randomTickSpeed
      

      I checked this with the following command and got the output below.

      /data get entity @p Inventory[{Slot:0b}]
      
      #output: {Slot: 0b, id: "minecraft:redstone", Count: 64b}
      

      However if put an item in that slot that has tag:{}

      /replaceitem entity @p hotbar.0 minecraft:redstone{} 5
      #item data: {Slot: 0b, id: "minecraft:redstone", Count: 5b, tag: {}}

      Then run the same command 

      /execute as @p store success entity @s Inventory[{Slot:0b}].tag.test byte 1 run gamerule randomTickSpeed
      #item data: {Slot: 0b, id: "minecraft:redstone", Count: 5b, tag: {test: 1b}}
      

       

      This was discovered while attempting to clear an item from the player only if the item has no data, the command below for example matches items with tag:{}

      /clear @p minecraft:redstone{} 0
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              AlphaFox13 Alpha
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: