Mojira Archive
MC-269742

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

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.

Invalid

mickel_7

2024-03-22, 12:14 AM

2024-04-05, 05:57 PM

2024-04-05, 05:57 PM

1

2

Unconfirmed

(Unassigned)

24w12a

-