The bug
If you tried to test void_air
block with execute if/unless block ...
command doesn't execute sub-command if the block can be edited. If you place yourself a void_air
block with /setblock
, the execute command works.This bug exists since void_air
and cave_air
was introduced in 18w06a.
How to reproduce
/execute if block 1000000 0 0 minecraft:void_air run tellraw @a "Unload block"
→ ❌ It fails
/execute unless block 1000000 0 0 minecraft:void_air run tellraw @a "Usable block"
→ ❌ It fails
If you test with cave_air
, it work if you test in caves or not as expected.
Comments 5
Yes, but normally, if you test with if
or unless
, at least one of the conditions should be validated, ok if you don't want to activate testing with void_air
, but validate unless
condition for each coordinate outside loaded/valid chunk.
Because the command is not able to see in the chunk, it cannot say that it’s not the blocks, as it could be said block but just not loaded.
Accessing blocks outside of loaded chunks just makes commands fail.
Those commands only allow for loaded chunks to be checked; that it's internally void_air does NOT mean the command will say "oh the chunk is unloaded, so I should consider this void air", it's still outside of loaded regions, and as such the command says that said block cannot be found/checked.