# Getting Started

## Installation

1. Stop the server.
2. Put `KyuubiSoftLootbag-2.0.4.jar` into the server's `mods/` folder. When you update, remove the old `KyuubiSoftLootbag-*.jar` first.
3. Make sure **KyuubiSoft Core** is installed as well (see [Requirements](https://wiki.kyuubisoft.com/hytale/lootbags/#requirements)); without it the server does not load Lootbags. DynamicTooltipsLib is optional.
4. Start the server. The plugin creates its data folder `mods/kyuubisoft_lootbag/` and writes the default files.

The UI textures (the shared KyuubiSoft UI kit) and all 150 bag items are inside the jar.

---

## Files after the first start

```
mods/
  KyuubiSoftLootbag-2.0.4.jar
  kyuubisoft_lootbag/
    config.json                main switches (see Configuration)
    configs/
      lootbags.json            the 150 shipped bags
      drop_tables.json         creature and mining drop rules
    custom/                    your bags and edits (custom_lootbags.json, written on the first save)
    localization/              en-US, de-DE, fr-FR, es-ES, pt-BR, ru-RU, pl-PL, tr-TR, it-IT (.json)
    data/
      players/<uuid>.json      per player: statistics, last 50 openings, opening window on/off
      latest_drops.json        the server's latest finds (last 30)
  kslang/                      language choices shared by all KyuubiSoft mods
```

Some files only appear once they are first written: `custom/custom_lootbags.json` after the first save in the admin panel or with `/lbadmin edit`, `data/players/` after the first player joins, `latest_drops.json` after the first opening. When the plugin saves `drop_tables.json`, `custom_lootbags.json` or a player file, it keeps the previous version as `.bak` next to it.

### What an update changes

- `config.json` is never overwritten. Settings that are new in 2.0.0 (`showDropSources`, `ignorePlacedBlocks`) are on by default and are written into the file the next time the settings or drop rules are saved in the admin panel.
- `configs/lootbags.json` and `configs/drop_tables.json` are only written when they are missing. Delete them if you want the shipped versions back.
- Four item IDs that do not exist in Hytale (`Food_Fruit`, `Food_Mushroom`, `Seed_Wheat`, `Seed_Pumpkin`) are replaced in memory when the bags load. Drop rules that point to the bag `Crystal_Lootbag_Epic` (which does not exist) are mapped to `Crystal_Lootbag`, the epic Crystal bag. Your files are not rewritten for this.
- Localization files older than version 11 are replaced. The old file is kept as `<lang>.json.backup-v<old version>`.
- Player files from 1.x keep their statistics; the History tab starts empty because 1.x did not store the items of each opening.

---

## First test

You need the `ks.lootbag.admin` permission for the admin command (see [Permissions](./permissions)).

1. **Get a bag.** Run `/lbadmin give Default_Lootbag 3`. Three common Default bags land in your inventory.
2. **Open one.** Hold a bag and right-click. The opening window shows what you received, split into *Guaranteed* and *Drawn at random*. Click **Open another (2)** to open the next one right there.
3. **Look into the catalog.** Run `/kslootbags`. Pick a style on the left and a tier above the contents to see every item with its chance and, under *Where to find*, where the bag drops.
4. **Place a bag.** Crouch and right-click with a bag in your hand. Press **F** on the placed bag: the catalog opens on that bag.
5. **Test a drop.** Kill any creature: with the shipped rules every creature has a 2 % chance to drop a Default bag. Mining ore (`Ore_*`) can drop Copper bags.
6. **Open the admin panel.** Run `/lbadmin panel`. See [Admin Panel](./admin-panel).

:::tip
`/kslootbags settings animation off` turns the opening window off for you; opened bags are then listed in the chat. `on` brings the window back.
:::

---

## Next steps

- [Configuration](./configuration): every field of `config.json`, the bag file and the drop rules
- [Custom Lootbags](./custom-lootbags): your own bags and changes to the shipped ones
- [Admin Panel](./admin-panel): editing bags and drop rules in game
- [FAQ & Troubleshooting](./faq): when something does not work