mojira.dev
MCPE-168391

Block state predicates in commands do not work properly (unprovided states require default value)

The bug

Unspecified states in block-checking commands are treated as though you specified the default value. This is fine for block-placing commands, but for block-checking commands, it's problematic.

How to reproduce

1. Place some acacia stairs facing all four directions

2. Run this command:

/fill ~-5 ~-5 ~-5 ~5 ~5 ~5 stone replace acacia_stairs["upside_down_bit":false]

Expected result
All stairs should be replaced with stone

Observed result
Only the west-facing stairs were replaced

Notes
This affects /execute if block as well. This is identical to MC-121690, which affected Java for a single snapshot in 2017. An equally hasty fix for bedrock would be much appreciated

Linked issues

Comments 3

I am experiencing the same issue:

/testforblock <x> <y> <z> <id>["button_pressed_bit":true]

This command does not detect the pressed button, unless I provide facing_direction:

/testforblock <x> <y> <z> <id>["button_pressed_bit":false,"facing_direction":1]

 

Now that block states have been enforced, this bug is now a bigger issue. Affects 1.19.73 and 1.20.0.21 Preview

Just to note, this goes for chiseled bookshelf block states as well...

tryashtar

(Unassigned)

997274, 997772, 1133402

Confirmed

Windows

1.20.10.20 Preview, 1.19.80.21 Preview, 1.19.70, 1.19.81 Hotfix, 1.20.0, 1.20.15 Hotfix, 1.20.51 Hotfix, 1.20.62 Hotfix, 1.21.43 Hotfix, 1.21.51 Hotfix

Retrieved