1. Wiki
  2. /Entities
  3. /minecraft:leashable

minecraft:leashable

Don't want to write this by hand? GodCraft sets minecraft:leashable for you with a switch.Get GodCraft

Overview

minecraft:leashable is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets players tie the entity to a lead, and fires events when it is leashed or freed.

Fields

FieldTypeDefaultDescription
can_be_cutBoolean"true"Lets players use shears on the entity to cut its leads.
can_be_stolenBoolean"true"Lets players leash the entity even when it is already leashed to someone else.
on_leashStringnoneEvent fired when the entity is leashed.
on_unleashStringnoneEvent fired when the entity is freed.
on_unleash_interact_onlyBoolean"false"Only fire the unleash event when a player frees it directly.
presetsListnoneLeash settings such as distances and spring strength; the first preset whose filter passes is used.
unleash_on_removalBoolean"true"Frees the entity when this component is removed.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:leashable": {
    "can_be_cut": "true",
    "can_be_stolen": "true",
    "on_leash": "",
    "on_unleash": "",
    "on_unleash_interact_only": "false",
    "presets": {},
    "unleash_on_removal": "true"
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more