跳转至

Rail Sensor

文档版本:1.21.0.24

Defines the behavior of the entity when the rail gets activated or deactivated.

架构

rail_sensor:
{
  boolean "check_block_types" : opt
  boolean "eject_on_activate" : opt
  boolean "eject_on_deactivate" : opt
  event_object "on_activate"
  event_object "on_deactivate"
  boolean "tick_command_block_on_activate" : opt
  boolean "tick_command_block_on_deactivate" : opt
}
check_block_typesboolean
If true, on tick this entity will trigger its on_deactivate behavior.
eject_on_activateboolean
If true, this entity will eject all of its riders when it passes over an activated rail.
eject_on_deactivateboolean
If true, this entity will eject all of its riders when it passes over a deactivated rail.
on_activateevent_object
Event to call when the rail is activated.
event_object:
{
  filters "filters"
  string "event" : opt
  string "target" : opt
}
filtersfilters
一个过滤器组
eventstring
The event to fire.
targetstring
The target of the event.
on_deactivateevent_object
Event to call when the rail is deactivated.
tick_command_block_on_activateboolean
If true, command blocks will start ticking when passing over an activated rail.
tick_command_block_on_deactivateboolean
If false, command blocks will stop ticking when passing over a deactivated rail.