跳转至

Leashable

文档版本:1.21.0.24

Allows this entity to be leashed and defines the conditions and events for this entity when is leashed.

架构

leashable:
{
  boolean "can_be_stolen" : opt
  number "hard_distance" : opt
  number "max_distance" : opt
  event_object "on_leash"
  event_object "on_unleash"
  number "soft_distance" : opt
}
can_be_stolenboolean
If true, players can leash this entity even if it is already leashed to another mob.
hard_distancenumber
Distance in blocks at which the leash stiffens, restricting movement.
max_distancenumber
Distance in blocks at which the leash breaks.
on_leashevent_object
Event to call when this entity is leashed.
event_object:
{
  filters "filters"
  string "event" : opt
  string "target" : opt
}
filtersfilters
一个过滤器组
eventstring
The event to fire.
targetstring
The target of the event.
on_unleashevent_object
Event to call when this entity is unleashed.
soft_distancenumber
Distance in blocks at which the spring effect starts acting to keep this entity close to the entity that leashed it.