mojira.dev
MC-135084

Executing if certain potion in inventory.

There are two different types of potions for each potion even water. One can be tested for one can't and they both look identical. One type is by using the give command: 

/give @p potion{Potion:fire_resistance}

The other is getting it from the creative inventory, brewing it, or if using water, filling it up with a water block.

/execute if entity @p[nbt={Inventory:[{id:"minecraft:potion",tag:{Potion:fire_resistance}}]}]

This detects only the ones that have to be produced by the command. The brewed can't be found.

Attachments

Comments 4

The brewed potions include the minecraft: namespace that you left out.

I don't think it's left out? Replace the command if it is so I can see what you mean.

/give @p potion{Potion:"minecraft:fire_resistance"}
/execute if entity @p[nbt={Inventory:[{id:"minecraft:potion",tag:{Potion:"minecraft:fire_resistance"}}]}]

Alex Smith

(Unassigned)

Unconfirmed

Minecraft 1.13

Retrieved