Skip to content

Blocks in Radius (Entity Condition Type)

Pug edited this page Mar 29, 2023 · 2 revisions

Tests to see if all blocks within an area match each individual block condition specified.

Type Resource Location: bovinesandbuttercups:block_in_radius

Introduced In: 1.3.0

Fields

Field Type Default Description
block_conditions Array of Block Conditions Defines all of the block conditions that must be individually met within the radius for this check to pass.
radius Float Defines the radius of the area that will be checked around the entity.
offset Array of Floats optional If set, defines the offset at which the area originates, this starts at the entity's position.

Example

"condition": {
  "type": "bovinesandbuttercups:blocks_in_radius",
  "radius": 6.0,
  "offset": [
    0,
    4,
    0
  ],
  "block_conditions": [
    {
      "type": "bovinesandbuttercups:block_location",
      "location": "minecraft:red_glazed_terracotta"
    },
    {
      "type": "bovinesandbuttercups:block_location",
      "location": "minecraft:orange_glazed_terracotta"
    }
  ]
}

This example checks if there is Red Glazed Terracotta and Orange Glazed Terracotta within a radius of 6 around the entity, the center of this radius also has an offset of 4 on the y axis.

Clone this wiki locally