2

execute unless air ~ ~ ~ doesn't work when you're in the void or in a cave.

Is there something like #air that joins all air blocks together, like #wool?

1
  • the void doesnt have blocks. That's why its the void! Maybe check if they're below 0?
    – Penguin
    Commented Feb 27, 2021 at 11:10

2 Answers 2

1

Unfortunately, there doesn't seem to an #air tag available in vanilla Minecraft.

One possible workaround is to simply duplicate the condition:

execute unless block ~ ~ ~ minecraft:air unless block ~ ~ ~ minecraft:cave_air run <...>

Note that you do not need to explicitly test for void_air as of Minecraft 1.16, as execute unless block will always fail in the void.

In theory, it should also be possible to create a predicate in a datapack that tests for the relevant criteria.

1

You can add your own tags to blocks. If you know datapacks you can add your own tag in .minecraft/saves/(worldname)/datapacks/(datapackname)/data/(datapacksubname)/tags/blocks (stuff between brackets isn't specific text). You have to create a .json file named whatever you want the name of the tag to be. In the file you write the following:

{
 "values":[
  "air",
  "cave_air",
  "void_air"
 ]
}

That should do it, then you can use #(tagname) in game.

Even if you don't know datapacks, you can just follow the file order I gave you, for example: .minecraft/saves/(worldname)/datapacks/airgrouping/data/airgrouping/tags/blocks/air.json

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .