Magic Leads Documentation

Magic Leads

A Paper plugin that makes leads magical:

  • Teleport with you — mobs you hold on a lead follow you through ender pearls, /tp, plugins, nether/end portals, and end gateways instead of being left behind. Full convoys come too: a happy ghast towing boats (1.21.6+ sneak-click lead transfers) arrives with every link intact.
  • Unbreakable — leads never snap from distance; the mob is pulled back to its holder instead. Applies to mob-held links in your convoy as well.
  • Attach to any mob — right-click any mob with a lead: villagers, zombies, iron golems, anything (configurable blacklist). Vanilla's sneak + right-click lead transfer gesture is left untouched.
  • Damage protection (optional) — leashed mobs can't be hurt, except by players if you allow it.
  • No lead duplication — lead totals stay honest across every teleport and portal.

Download Magic Leads on SpigotMC

The Chain Rule

All of the above applies to a leashed entity only when following its holder chain upward reaches a player (you → ghast → boat = magic, end to end). Two mobs tied to each other with no player involved — or a mob tied to a fence post — behave purely vanilla, including damage.

Requirements

  • Paper (or a Paper fork) 1.21.11
  • Java 21
  • Folia is supported — all scheduling and teleporting is region-aware, so the plugin runs on Folia builds as well as regular Paper.

Installation

  1. Add the Magic Leads jar into your plugins folder.
  2. Restart your server.
  3. Edit config.yml to your liking.
  4. Type /magicleads reload.

Commands

CommandPermissionDefault
/magicleads (alias /ml) — show feature statuseveryone
/magicleads reload — reload config.yml + messages.ymlmagicleads.reloadop
/magicleads debug <scenario> — run built-in test scenarios (also requires debug.enabled)magicleads.debugop

Permissions

PermissionDefaultMeaning
magicleads.leashany.*everyoneAttach a lead to any mob type.
magicleads.leashany.<type>unsetAttach a lead to one mob type, e.g. magicleads.leashany.villager.
magicleads.leashanyunsetLegacy catch-all for any mob type.
magicleads.reloadopReload the plugin.
magicleads.debugopRun debug scenarios.

To restrict leashing per mob type, negate magicleads.leashany.* in your permissions plugin and grant the specific magicleads.leashany.<type> nodes you allow.

Player-facing text lives in messages.yml (MiniMessage format) — restyle or translate freely.

Configuration

All settings live in config.yml. Run /magicleads reload after editing.

KeyDefaultMeaning
disabled-worlds[]Worlds where Magic Leads is disabled — a YAML list of real world (folder) names, case-insensitive; an empty list keeps it active everywhere. Run /magicleads to see the effective list; entries matching no loaded world are warned about in the console on reload.
teleport-with-player.enabledtrueLeashed mobs teleport along with you.
teleport-with-player.causespearls, commands, plugins, nether portals, end portals, end gateways, chorus fruitWhich teleport causes bring mobs along. Valid values are Bukkit TeleportCause names.
teleport-with-player.min-distance8.0Same-world teleports shorter than this are ignored — the vanilla leash survives anything under 12 blocks anyway.
teleport-with-player.reattach-delay-ticks10Delay before re-attaching the leash after arrival.
teleport-with-player.block-mob-portalstrueLeashed mobs can't wander through portals alone.
teleport-with-player.include-convoystrueEntities leashed to your mobs (towed boats etc.) teleport along too.
unbreakable.enabledtrueDistance never snaps a lead; the mob is pulled to you.
unbreakable.mob-held-leadstrueMob-held links in a player-rooted chain never snap either.
leash-anything.enabledtrueLeads attach to any mob.
leash-anything.blacklistENDER_DRAGON, WITHEREntity types that can never be leashed.
damage-protection.enabledtrueLeashed mobs can't be damaged.
damage-protection.allow-player-damagetrue…except by players (melee or projectile).
debug.enabledfalseEnables the /magicleads debug test scenarios. Leave off in production.

Developer API

Other plugins can hook Magic Leads via events in fun.sunrisemc.magicleads.api. Add the Magic Leads jar to your project as a provided scope dependency.

  • ConvoyTeleportEvent (cancellable) — fires before a player's convoy is escorted through a teleport; cancel it to leave the leads vanilla for that teleport.
  • LeadPullEvent (cancellable) — fires before a stray mob is pulled back to its holder instead of the lead snapping; cancel it to allow the vanilla snap.
  • MobStrandEvent — fires when an escort fails and a mob is freed; call setDropLead(false) to suppress the lead-item refund.

Metrics

The plugin reports anonymous usage statistics to bStats — server count, platform, and which of the four config-gated features (teleport-with-player, unbreakable, leash-anything, damage-protection) are enabled. Nothing identifying is collected.

To opt out, set enabled: false in plugins/bStats/config.yml, which disables bStats for every plugin on the server at once.