diff --git a/docs/blocks/block-tags.md b/docs/blocks/block-tags.md index 848aded6331..d89ed8cf477 100644 --- a/docs/blocks/block-tags.md +++ b/docs/blocks/block-tags.md @@ -21,7 +21,7 @@ Block tags can be used to ensure that a block meets certain conditions. ## Applying Tags -Block tags can be applied in the same way as items - in the block's `components` - as seen below: +Block tags can be applied in the block's `components`, prefixed with `tag:`, as seen below: BP/blocks/tree_stump.json @@ -46,16 +46,42 @@ Block tags can be applied in the same way as items - in the block's `components` ## Testing for Tags -Tags can be queried with: +### From Block Descriptors - `q.all_tags` - `q.any_tag` + +Block Descriptor + +```json +{ + "tags": "q.any_tag('wiki:glowing') && q.all_tags('wiki:custom_ore', 'stone')" +} +``` + +### From Entities + +- `q.relative_block_has_all_tags` +- `q.relative_block_has_any_tag` - `q.block_has_all_tags` - `q.block_has_any_tag` + +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` - `q.block_neighbor_has_any_tag` -- `q.relative_block_has_all_tags` -- `q.relative_block_has_any_tag` Example of an item querying a block's tags: