Block Tags
Block tags can be used to ensure that a block meets certain conditions.
Applying Tags
Block tags can be applied in the block's components, prefixed with tag:, as seen below:
BP/blocks/tree_stump.json
json
{
"format_version": "1.21.120",
"minecraft:block": {
"description": {
"identifier": "wiki:tree_stump",
"menu_category": {
"category": "nature"
}
},
"components": {
"tag:wood": {},
"tag:minecraft:is_axe_item_destructible": {},
"tag:wiki:very_useless": {}
}
}
}Testing for Tags
From Block Descriptors
q.all_tags(...tags)- Returns whether the block has all of the listed tags.
q.any_tag(...tags)- Returns whether the block has at least one of the listed tags.
Block Descriptor
json
{
"tags": "q.any_tag('wiki:glowing') && q.all_tags('wiki:custom_ore', 'stone')"
}From Entities
q.block_has_all_tags(x, y, z, ...tags)- Returns whether the block at the specified coordinates has all of the listed tags.
q.block_has_any_tag(x, y, z, ...tags)- Returns whether the block at the specified coordinates has at least one of the listed tags.
q.relative_block_has_all_tags(x, y, z, ...tags)- Returns whether the block at the specified offset from the entity has all of the listed tags.
q.relative_block_has_any_tag(x, y, z, ...tags)- Returns whether the block at the specified offset from the entity has at least one of the listed tags.
minecraft:client_entity > description
json
"scripts": {
"pre_animation": [
"v.is_on_sand = q.relative_block_has_any_tag(0, -1, 0, 'sand');"
]
}Additional Queries
NOTE: The following query functions have no known use cases.
q.block_neighbor_has_all_tags(x, y, z, ...tags)q.block_neighbor_has_any_tag(x, y, z, ...tags)
Digger Example
Example of an item querying a block's tags:
BP/items/custom_pickaxe.json
json
{
"format_version": "1.21.120",
"minecraft:item": {
"description": {
"identifier": "wiki:custom_pickaxe",
"menu_category": {
"category": "equipment",
"group": "minecraft:itemGroup.name.pickaxe"
}
},
"components": {
"minecraft:digger": {
"use_efficiency": true,
"destroy_speeds": [
{
"speed": 5,
"block": {
"tags": "q.any_tag('minecraft:is_pickaxe_item_destructible')"
}
}
]
}
}
}
}List of Vanilla Tags
Tag | Vanilla Usage | Functionality |
|---|---|---|
acacia |
| |
birch |
| |
minecraft:cornerable_stairs |
| |
minecraft:crop |
|
|
dark_oak |
| |
diamond_pick_diggable |
| Deprecated — check for the minecraft:is_pickaxe_item_destructible and minecraft:diamond_tier_destructible tags instead. |
minecraft:diamond_tier_destructible |
|
|
dirt |
|
|
fertilize_area |
| |
grass |
| |
gravel |
| Allows Bamboo to be placed on the block. |
iron_pick_diggable |
| Deprecated — check for the minecraft:is_pickaxe_item_destructible and minecraft:iron_tier_destructible tags instead. |
minecraft:iron_tier_destructible |
|
|
minecraft:is_axe_item_destructible |
|
|
minecraft:is_hoe_item_destructible |
|
|
minecraft:is_pickaxe_item_destructible |
|
|
minecraft:is_shears_item_destructible |
|
|
minecraft:is_shovel_item_destructible |
|
|
minecraft:is_sword_item_destructible |
|
|
jungle |
| |
log |
| |
metal |
| |
mob_spawner |
| |
not_feature_replaceable |
| |
oak |
| |
one_way_collidable |
| Prevents entities inside a block from being automatically pushed out of the block's collision. |
plant |
| |
pumpkin |
| |
rail |
|
|
sand |
| Allows cacti and sugarcane to be placed on the block. |
snow |
| |
spruce |
| |
stone |
| |
stone_pick_diggable |
| Deprecated — check for the minecraft:is_pickaxe_item_destructible and minecraft:stone_tier_destructible tags instead. |
minecraft:stone_tier_destructible |
|
|
text_sign |
| |
trapdoors |
| Trapdoors are avoided by the Breeze. |
water |
| Allows Sugar Cane to be placed on horizontally adjacent blocks that have the dirt tag. |
wood |
|
Contributors
Edit Block Tags on GitHubText and image content on this page is licensed under the Creative Commons Attribution 4.0 International License
Code samples on this page are licensed under the MIT License











