-
Bug
-
Resolution: Duplicate
-
None
-
1.19.70
-
None
-
Unconfirmed
-
iOS
Place down any kind of button. Type in the command:
/testforblock <x> <y> <z> <id>["button_pressed_bit":false]
and replace <x>, <y>, and <z> with the coordinates of the button and <id> with the identifier of the button (e.g. wooden_button).
The command should detect the button if it is not pressed, but even though the button matches the specified state, the following error appears:
The block at <x>,<y>,<z> did not match the expected block state.
However, adding facing_direction to the command fixes the issue:
/testforblock <x> <y> <z> <id>["button_pressed_bit":false,"facing_direction":1]
In this case, the value of facing_direction is 1 because the button was placed on top of a block and is facing up.
The command also works without button_pressed_bit:
/testforblock <x> <y> <z> <id>["facing_direction":1]
The output is:
Successfully found the block at <x>,<y>,<z>.
As you can see, providing only button_pressed_bit (without facing_direction) does not detect the button, regardless of its state.
- duplicates
-
MCPE-168391 Block state predicates in commands do not work properly (unprovided states require default value)
- Open