If you fill an area that includes a block on a northwest chunk border and y=80, 96, 112, 128, 144, 160, 178, 192, 208, 224, or 240, with cave air, then fill that same area with any block replacing type=air, it will replace any and all blocks on a northwest chunk border at all of the specified y levels, along with three more blocks which create a square. One corner of this square is the block that is on the northwest chunk border and the opposite corner is the northwest corner of the fill command. This blocks shouldn't have been filled, as they were supposed to be cave air, not regular air. Even more strangely, if you then try to fill that same area with cave are again, the chat will say that the blocks are filled, but they will still be there. They are real blocks too, and didn't disappear after leaving and rejoining the world.
Reproducing the bug:
Create new minecraft world in creative, go to 0, 0
Use command "/fill 1 0 1 -4 255 -4 minecraft:cave_air"
Use command "/fill 1 0 1 -4 255 -4 minecraft:gold_block replace air"
Use command (again) "/fill 1 0 1 -4 255 -4 minecraft:cave_air"
Linked issues
Attachments
Comments


For me, after filling the area with cave air again, the gold blocks disappear after leaving the world though.
The bug seems to only occur in chunk sections that contain only air-like blocks.
It also affects the execute if blocks
command:
setblock 0 99 0 air
setblock 0 98 0 cave_air
setblock 0 97 0 stone
execute if blocks 0 99 0 0 99 0 0 98 0 all
→✔ The command fails.
setblock 0 97 0 air
execute if blocks 0 99 0 0 99 0 0 98 0 all
→❌ The command succeeds as the chunk section contains only air-like blocks.

it should be started with this question: does cave_air have any slight difference with regular air? (like cave_air is automatically filled in when enclosed after using setblock, fill commands or structure blocks)
the minecraft wiki says there are none but if there is, similar bugs may occur over and over again when using commands.

cave_air is only relevant to world generation and should never be saved. Currently there are other bugs in the game (such as this one and https://bugs.mojang.com/browse/MC-232359) which make it possible to detect a difference between the air types.

Confirmed in 1.19.4-pre1
Can confirm in 1.20.5 Pre-Release 1. The results are incredibly inconsistent:
[media]
Confirmed in 1.16.4-pre2.