Beta
Allows this entity to be leashed and defines the conditions and events for this entity when is leashed.
import { world } from "@minecraft/server";const entity = world.getEntity("-10000000000");const leashHolderEntity = world.getEntity("-10000000000");const leashable = entity.getComponent("leashable");leashable.softDistance;leashable.leashTo(leashHolderEntity); // Assuming you have an 'leashHolderEntity' instanceleashable.unleash();leashable.isValid(); Copy
import { world } from "@minecraft/server";const entity = world.getEntity("-10000000000");const leashHolderEntity = world.getEntity("-10000000000");const leashable = entity.getComponent("leashable");leashable.softDistance;leashable.leashTo(leashHolderEntity); // Assuming you have an 'leashHolderEntity' instanceleashable.unleash();leashable.isValid();
Readonly
The entity that owns this component. The entity will be undefined if it has been removed.
Distance in blocks at which the 'spring' effect starts acting to keep this entity close to the entity that leashed it.
This property can throw when used.
Identifier of the component.
Static
Whether the component is valid.
Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.
The entity to leash this entity to.
Leashes this entity to another entity.
This function can't be called in read-only mode.
This function can throw errors.
Unleashes this entity if it is leashed to another entity.
Allows this entity to be leashed and defines the conditions and events for this entity when is leashed.
Example: entityLeashable.js