# Chain
Chain is a free entity chaining and leashing plugin for Paper servers. It allows you to chain any two living entities together with a configurable maximum distance, automatic pull-back mechanics, and seamless teleportation handling.
---
## Requirements
- **Java 17** or higher
- **Paper 1.20** or higher
## Optional Dependencies
| Dependency | Purpose |
|---|---|
| Bookshelf | Lodestone core library providing configuration utilities |
All-in-all, you **do not** need to install any additional plugins.
## Features
- **Entity Chaining** — Chain any two living entities (players, mobs, etc.) together. Chained entities are visually connected with a lead and pulled toward each other when they exceed the maximum distance.
- **Player-to-Player Chains** — When two players are chained, invisible Vex entities serve as leash anchors so the lead renders correctly between both players.
- **Automatic Pull-Back** — When chained entities exceed the configured max distance, velocity is applied to pull them back together. If they exceed 2.5x the max distance, the further entity is teleported directly.
- **Teleport Synchronization** — When a chained player teleports, all entities chained to them are teleported to the destination automatically.
- **Join Handling** — When a chained player logs back in, they are teleported to their chain partner's location.
- **Death Handling** — Chains are automatically removed when a chained player dies.
- **Vehicle Support** — Chains work correctly when one or both entities are riding a vehicle.
## Installation
1. Download Chain from [lode.gg](https://lode.gg/plugin/chain).
2. Place the `Chain.jar` file into your server's `plugins/` directory.
3. Start the server to generate the default configuration.
4. Adjust `max_distance` in `config.yml` if needed.
## Quick Start
1. Run `/chain <target>` as a player to chain yourself to the target entity.
2. Run `/chain <target> <targets>` to chain the first target to one or more other entities.
3. Run `/unchain <targets>` to remove chains from entities.
---
## Related Pages
- [[Chain/Server Owners/Configuration]] — Config file reference
- [[Chain/Server Owners/Commands]] — Full command and permission listing
- [[Lead/Developers/Overview]] — Developer integration guide
- [[Lead/Developers/API Reference]] — Chain-API class reference