# Chain
Chain ties two living things together with a visible lead. Players, mobs, anything alive. Wander too far apart and the chain pulls you back toward each other.
It's free, and it works on its own. Nothing else to install.
## Try it
Stand near a pig and run:
```
/chain @e[type=pig,limit=1,sort=nearest]
```
You're now leashed to it. Walk away and you'll feel the tug. When you've had enough:
```
/unchain @s
```
## What it does
**Ties anything to anything.** Two players, a player and a mob, two mobs. A lead appears between them.
**Pulls you back.** Go past the maximum distance (3 blocks by default) and you both get nudged back together. Go a lot further, roughly two and a half times that, and whoever strayed gets yanked back instantly.
**Keeps up with teleports.** Teleport while chained and everyone attached comes along. Log out and back in and you'll arrive next to whoever you're chained to.
**Handles vehicles.** Works fine if one or both of you is in a boat or on a horse.
**Lets go on death.** Dying breaks the chain rather than dragging your corpse around.
## Installing it
1. Download Chain from [lode.gg](https://lode.gg/plugin/chain).
2. Drop `Chain.jar` into your `plugins/` folder.
3. Start the server. It writes its config on first boot.
4. Change `max_distance` if 3 blocks isn't right for you.
## What you need
| | |
|---|---|
| Server | Paper 1.20 or newer |
| Java | 17 or newer |
Bookshelf is supported if you have it, but Chain doesn't need it.
## Related Pages
- [[Chain/Server Owners/Configuration]], the one setting
- [[Chain/Server Owners/Commands]], every command
- [[Lead/Developers/Overview]], for plugin developers