minecraft:block_sensor¶
文档版本:1.21.0.24
Fires off a specified event when a block in the block list is broken within the sensor range.
架构¶
minecraft:block_sensor:
{
array "on_break" : opt
{
object "<any array element>" : opt
{
array "block_list" : opt
{
block_descriptor "<any array element>"
}
string "on_block_broken" : opt
}
}
number "sensor_radius" : opt
array "sources" : opt
{
entity_filters "<any array element>"
}
}
on_break
:array
on_break
<any array element>
:object
<any array element>
block_list
:array
block_list
<any array element>
:block_descriptor
block_descriptor:
{
string "name" : opt
object "states" : opt
{
string "<any object property>" : opt
integer "<any object property>" : opt
}
expression_node_string "tags"
}
name
:string
states
:object
states
<any object property>
:string
<any object property>
:integer
tags
:expression_node_string
on_block_broken
:string
sensor_radius
:number- The maximum radial distance in which a specified block can be detected. The biggest radius is 32.0.
sources
:array- List of sources that break the block to listen for. If none are specified, all block breaks will be detected.
sources
<any array element>
:entity_filters
any_of
:sub_filter
sub_filter:
{
string "test" : opt
string "subject" : opt
string "operator" : opt
string "value" : opt
}
test
:string
subject
:string
operator
:string
value
:string
sub_filter:
array
{
object "<any array element>" : opt
{
string "test" : opt
string "subject" : opt
string "operator" : opt
string "value" : opt
}
}
<any array element>
:object
<any array element>
test
:string
subject
:string
operator
:string
value
:string
all_of
:sub_filter
none_of
:sub_filter