Too Many Attributes
» Entity actions » Connected blocks

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.

FieldTypeDefaultDescription
block_actionBlock actionrequiredWhat runs on each connected block.
block_conditionBlock conditionsame blockWhich blocks count as part of the group. Left out: the same block as the one the action runs on.
neighbor_conditionBlock conditionoptionalAt 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.
diagonalBooleantrueBlocks touching only at an edge or corner also connect.
downwardBooleantrueThe group can spread downward.
limitInteger64The 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 reaches limit before a matching neighbor is found does nothing.
  • From Overgrown's Apoli: actor_condition and the count and index expression values aren't supported. The other fields match.

Example: "Lumberjack". Breaking a log breaks the rest of the tree too, if it has leaves.

json
{
  "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
}