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

Testing for "minecraft:custom_data" incorrectly with the /execute if items command.

XMLWordPrintable

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

      With the "minecraft:custom_data" component, I put two tags in that component of that item however the goal is to only check for only one of those tags to be a set value using the "/execute if items" command.

      I am reporting this bugs as I noticed the command in considered the other tags in the component and output an unexpected Boolean.

      To replicate this issue as an demonstration, the command ran is:
      /give @s minecraft:diamond[minecraft:custom_data=\{shiny:1b, large:1b}]
      While holding the given diamond has the selected item, run the command:
      /execute if items entity @s weapon.mainhand minecraft:diamond[minecraft:custom_data=\{shiny:1b}] run say Approved
      Expected outcome: Chat: [Username] Approved
      Actual outcome: Nothing happens

      However if this command is run instead:

      /execute if items entity @s weapon.mainhand minecraft:diamond[minecraft:custom_data=\{shiny:1b, large:1b}] run say Approved

      The outcome: Chat: [Username] Approved

      It seems that the component that is searched is checking the entire field of the component instead of searching for specific NBT tags.

            Unassigned Unassigned
            mickel_7 mickel_7
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: