Script API - v1.20.0
    Preparing search index...

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

    Hierarchy (View Summary)

    Index

    Properties

    entity: Entity

    The entity that owns this component.

    softDistance: number

    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.

    typeId: string

    Identifier of the component.

    componentId: "minecraft:leashable" = 'minecraft:leashable'

    Identifier of this component. Should always be minecraft:leashable.

    Methods

    • Beta

      Parameters

      • leashHolder: Entity

        The entity to leash this entity to.

      Returns void

      Leashes this entity to another entity.

      This function can't be called in read-only mode.

      This function can throw errors.

    • Beta

      Returns void

      Unleashes this entity if it is leashed to another entity.

      This function can't be called in read-only mode.

      This function can throw errors.