# Kits
Bookshelf's kit system allows you to save a player's entire state, inventory, health, hunger, XP, potion effects, and optionally their location, and restore it later. Kits can be shared between servers via export codes.
---
## Opening the Kit GUI
```
/kit
```
Opens a menu showing all available kits. From the GUI you can view kit contents and apply them.
---
## Saving a Kit
```
/kit save [player] <id> [-l]
```
Saves the target player's current state as a kit with the given ID. If no player is specified, saves your own state.
**What gets saved:**
- Full inventory contents (including armor and offhand)
- Health and max health
- Food level and saturation
- Experience level and points
- Absorption hearts
- Fire ticks
- All active potion effects (type, amplifier, duration)
- Location (only if `-l` flag is used)
Each kit is stored as a YAML file in the `kits/` folder with a timestamp.
---
## Loading a Kit
```
/kit give [targets] <kit>
```
Applies a kit to yourself or specified targets. This restores all saved state: inventory, health, stats, and potion effects. If the kit has a saved location and the world exists, the player is teleported there.
### Weighted Random Selection
You can specify multiple kits with weights for random selection:
```
/kit give <targets> 50%warrior,30%archer,20%mage
```
Each kit is given a probability weight. In this example:
- 50% chance of receiving the **warrior** kit
- 30% chance of receiving the **archer** kit
- 20% chance of receiving the **mage** kit
This is useful for random class assignment in minigames or events.
### Wildcard Patterns
Instead of typing every kit name, use a pattern to match several at once:
```
/kit give @a kit_*
/kit give @a 25%kit_[1-3],75%kit_[4-5]
```
| Pattern | Matches | Example |
|---|---|---|
| `*` | Any characters | `kit_*` matches `kit_1`, `kit_12`, `kit_pvp` |
| `?` | Exactly one character | `kit_?` matches `kit_1` but not `kit_12` |
| `[1-12]` | A number in the range | `kit_[1-3]` matches `kit_1`, `kit_2`, `kit_3` |
| `[135]` | Any one of those characters | `kit_[135]` matches `kit_1`, `kit_3`, `kit_5` |
Matching ignores case.
How weights work with patterns:
- **No weight**: every matched kit gets an equal chance, same as listing them all by hand. `kit_*` with five kits gives each one 20%.
- **With a weight**: the weight is split evenly across the matches. In `25%kit_[1-3],75%kit_[4-5]`, kits 1 to 3 get about 8.3% each and kits 4 and 5 get 37.5% each.
- If a kit matches more than one entry, its chances add up.
- A pattern that matches no kits stops the command with a "kit not found" error.
Weights can be decimals (`12.5%kit_1`). The confirmation message lists each kit with its actual chance.
### Tab Completion
Tab completion helps you build the list:
- **Pattern suggestions**: any group of two or more numbered kits (`kit_1` to `kit_5`) gets a `kit_*` and a `kit_[1-5]` suggestion next to the plain kit names.
- **Match preview**: hover a pattern, including one you typed yourself, to see which kits it would pick. A pattern that matches nothing says so in red.
- **Weights carry over**: type a weight first (`25%` or just `25`) and every suggestion keeps it, like `25%kit_*`.
- **No repeats**: kits and patterns already in the list aren't suggested again.
---
## Exporting and Importing Kits
### Export
```
/kit export <id>
```
Generates a shareable code for the kit using GZIP compression and Base64 encoding. If the code is short (under 200 characters), it's displayed directly. Otherwise, it's uploaded to [mclo.gs](https://mclo.gs) and a clickable URL is returned.
### Import
```
/kit import <id> <code>
```
Imports a kit from a code or mclo.gs URL and saves it with the given ID.
---
## Deleting a Kit
```
/kit delete <id>
```
Removes the kit file permanently.
---
## Permissions
| Permission | Description |
|---|---|
| `lodestone.bookshelf.commands.utility.kit` | Base kit command and GUI access |
---
## Related Pages
- [[Bookshelf/Server Owners/Commands]] - Quick command reference
- [[Bookshelf/Server Owners/Features/Utilities]] - Other utility commands