mojira.dev
MC-172929

Clear fails to work more than once when checking for a specific item in a specific slot.

Bug discovered in 1.15.2, possibly in other versions.

Using the following command block setup I discoverd a bug that continued to show results even with modified setups.

This setup aims to ensure that if a compass is moved out of hotbar slot 9 (hotbar.8), it is placed back in slot 9. It works, but only once. After moving the "restored" compass, the clear command does not activate unless the compass is first moved back to slot 9. The same issue occured when my friend tried to replicate the setup on a singleplayer world.

CB1: Repeat|Unconditional|AlwaysActive: execute as @a unless entity @s[nbt={Inventory:[{id:"minecraft:compass",Slot:8b}]}] run clear @s minecraft:compass

CB2: Chain|Conditional|AlwaysActive (Runs after CB1 succeeds): replaceitem entity @a hotbar.8 minecraft:compass

Comments 1

Does MC-29318 describe your issue? It may be the more general case.

Ryan Perry

(Unassigned)

Unconfirmed

(Unassigned)

1.15.2

Retrieved