Blocks in Radius (Entity Condition Type) - MerchantCalico/bovines-and-buttercups-archive GitHub Wiki
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](/MerchantCalico/bovines-and-buttercups-archive/wiki/Array-(Data-Type)) of [Block Conditions](/MerchantCalico/bovines-and-buttercups-archive/wiki/Block-Condition-Types-(Datapacking)) | Defines all of the block conditions that must be individually met within the radius for this check to pass. | |
radius |
[Float](/MerchantCalico/bovines-and-buttercups-archive/wiki/Float-(Data-Type)) | Defines the radius of the area that will be checked around the entity. | |
offset |
[Array](/MerchantCalico/bovines-and-buttercups-archive/wiki/Array-(Data-Type)) of [Floats](/MerchantCalico/bovines-and-buttercups-archive/wiki/Float-(Data-Type)) | 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.