Connected blocks
too-many-attributes:connected_blocksblock action
Runs a block action on every block connected to this one, like a tree trunk or an ore vein. Blocks closer to the start go first.
| Field | Type | Default | Description |
|---|---|---|---|
block_action | Block action | required | What runs on each connected block. |
block_condition | Block condition | same block | Which blocks count as part of the group. Left out: the same block as the one the action runs on. |
neighbor_condition | Block condition | optional | At least one block touching the group, and outside it, must match. Otherwise nothing runs. Use it to check that logs touch leaves, so a log cabin isn't mistaken for a tree. |
diagonal | Boolean | true | Blocks touching only at an edge or corner also connect. |
downward | Boolean | true | The group can spread downward. |
limit | Integer | 64 | The most blocks it runs on. At most 1024. |
- The block the action runs on isn't included. Run your action on it separately.
- Unloaded chunks are skipped. It never loads chunks.
- With
neighbor_condition, a group that reacheslimitbefore a matching neighbor is found does nothing. - From Overgrown's Apoli:
actor_conditionand thecountandindexexpression values aren't supported. The other fields match.
Example: "Lumberjack". Breaking a log breaks the rest of the tree too, if it has leaves.
{
"type": "origins:action_on_block_break",
"block_condition": {
"type": "origins:in_tag",
"tag": "minecraft:logs"
},
"block_action": {
"type": "too-many-attributes:connected_blocks",
"block_condition": {
"type": "origins:in_tag",
"tag": "minecraft:logs"
},
"neighbor_condition": {
"type": "origins:in_tag",
"tag": "minecraft:leaves"
},
"downward": false,
"limit": 128,
"block_action": {
"type": "origins:execute_command",
"command": "setblock ~ ~ ~ minecraft:air destroy"
}
},
"only_when_harvested": true
}