# Getting Started

**Version:** 2.0.1

## 1. Install the plugin

1. Stop the server.
2. Put `KyuubiSoftGraveyard-2.0.1.jar` into the server's `mods/` folder. When you update, remove the old `KyuubiSoftGraveyard-*.jar` first. Keep `KyuubiSoftGraveyard_Designs.jar` if you have one: it holds your custom designs.
3. Optional: VaultUnlocked with an economy plugin, if players should pay for designs, particles or teleports.
4. Start the server.

```
mods/
  KyuubiSoftGraveyard-2.0.1.jar
```

No other mod is needed.

---

## 2. Files after the first start

```
mods/
  kyuubisoft_graveyard/
    config/
      graveyard.json        main configuration
    graveyard.db            SQLite database (gravestones, player data, statistics)
    custom-items/
      _template.json        template for a custom design (ignored because of the "_")
      README.txt
    images/
      gravestone_bg.png     background of the classic grave window
      loot_all_button.png   "Loot All" button of the classic grave window
    avatar-cache/           player heads from hyvatar.io
  kslang/                   language choice shared by all KyuubiSoft mods
```

- `KyuubiSoftGraveyard_Designs.jar` appears in `mods/` once you add a custom design, see [Custom Designs](./custom-designs).
- An `i18n/` folder for language overrides is not created; add it yourself when you need it, see [Configuration](./configuration#languages).
- With MySQL (`database.type: "mysql"`) there is no `graveyard.db`.

---

## 3. Check the start

The plugin logs lines like these during the start:

```
[Graveyard] Setting up...
Default config created at mods/kyuubisoft_graveyard/config/graveyard.json
[Graveyard] i18n loaded: [en-US, de-DE, fr-FR, ...]
[Graveyard] Using SQLite database: .../mods/kyuubisoft_graveyard/graveyard.db
Database tables initialized
[Graveyard] Interactions registered
[Graveyard] Setup complete
[Graveyard] Starting...
[Graveyard] Started (0 gravestones loaded)
```

On later starts the second line reads `Config loaded from ...`.

If the database cannot be opened, the plugin logs `[Graveyard] Failed to initialize database: ...` and `[Graveyard] DISABLED — no gravestones will be created or loaded ...`. The server keeps running, but the graveyard does nothing until the database works and the server is restarted. See [FAQ](./faq#the-log-says-the-graveyard-is-disabled).

---

## 4. Basic configuration

Open `mods/kyuubisoft_graveyard/config/graveyard.json`. The most important options:

| Option | Default | Meaning |
|--------|---------|---------|
| `protectionTimerSeconds` | `300` | Seconds only the owner can loot a new gravestone. `0` or less = no protection |
| `gravestoneLifetimeSeconds` | `-1` | Seconds until a gravestone disappears with its contents. `0` or less = never |
| `maxGravestonesPerPlayer` | `5` | Gravestones per player; dying once more removes the oldest. `0` or less = no limit |
| `allowTeleportToGravestone` | `false` | Teleport button in the menu (same world only) |
| `teleportCost` | `0` | Price of a teleport, `0` = free |
| `purchaseWithEconomy` | `true` | Prices are paid with the server economy |
| `enableParticles` | `true` | Particles above gravestones, the Particles tab and the particle commands |
| `classicLootLook` | `false` | `true` = the old stone grave window instead of the new one |
| `excludedWorlds` | `[]` | Worlds without gravestones |

Apply changes with `/ksgraveyard reload`. A few options need a restart, see [Configuration](./configuration#reload-or-restart).

---

## 5. Economy (optional)

Designs and particles with a price, and teleports with a cost, are paid with the server economy:

1. Install VaultUnlocked and an economy plugin that registers with it (for example Ecotale). With KyuubiSoft Core installed, the graveyard uses Core's economy bridge; otherwise it connects to VaultUnlocked directly.
2. Leave `purchaseWithEconomy` on `true` (the default).
3. Restart and open `/ksgraveyard menu`. When the economy is found, the header of the menu shows the player's balance.

The economy is looked up the first time something needs it (usually when a player opens the menu). The log then shows `Economy via Core's ExternalEconomyBridge`, `Economy via VaultUnlocked direct (<name>)` or `No economy provider detected`. The result is kept until the next restart.

Without an economy, premium designs and particles cannot be bought; unlock them with `design_give` and `particle_give`. Keep `teleportCost` at `0` then, or the teleport cannot be paid.

---

## 6. Test it

1. Join in Adventure mode with a few items in your inventory. Creative mode never creates a gravestone.
2. Die (fall damage, `/kill`, ...). The chat shows "Your gravestone was placed. Coordinates: X, Z" and a notification "Gravestone placed" with the full coordinates.
3. Respawn and run `/ksgraveyard menu`. The Gravestones tab lists the new gravestone with its contents.
4. Walk to the gravestone and press **F**. The grave window opens; press **Loot all**. The items go into your inventory and the gravestone disappears.

What goes into the gravestone depends on the world's death settings. If nothing goes in, no gravestone is placed, see [FAQ](./faq#i-died-but-no-gravestone-appeared).

---

## 7. Admin quick reference

```
/ksgraveyard admin_list <player>                 gravestones of a player with IDs
/ksgraveyard admin_remove <id>                   delete one gravestone (with its contents)
/ksgraveyard admin_clear <player>                delete all gravestones of a player
/ksgraveyard admin_tp <id>                       teleport to a gravestone
/ksgraveyard admin_stats <player>                statistics of a player
/ksgraveyard design_give <player> <design>       unlock a design
/ksgraveyard particle_give <player> <particle>   unlock particles
/ksgraveyard reload                              reload config, designs and languages
```

Admins need `ks.graveyard.admin`, see [Permissions](./permissions). Player names only work for players who are online, see [Commands](./commands#choosing-the-player).

---

## Updating from 1.x

- Your `graveyard.json` stays. On the first start, the options added by 2.0.0 (`purchaseWithEconomy`, `classicLootLook`, ...) are written into it; your values are kept.
- Existing gravestones keep working; gravestones saved before 2.0.0 load as before. From 2.0.0 on, gravestones also store item data such as enchantments.
- The grave window has a new look. To keep the old stone window and your images in `images/`, set `classicLootLook` to `true`.
- Admins only need `ks.graveyard.admin`; the old `graveyard.admin` is no longer checked.
- Premium designs and particles with a price can now be bought with the server economy. To keep the old behaviour (admin-only), set `purchaseWithEconomy` to `false`.
- A design whose block cannot open the grave window (a block of another mod, or a custom design before its second restart) now places the built-in gravestone block instead. Gravestones placed with such a block before 2.0.0 cannot be opened; remove them with `/ksgraveyard admin_remove <id>`.
- `captureMode` and `showWorldMapMarker` in your config now work. Check that their values are what you want (defaults `"DROPPED_ONLY"` and `true`), see [Configuration](./configuration#capture-and-map-markers).

---

## Next steps

- [Commands](./commands) for the full syntax
- [Configuration](./configuration) for every option
- [UI Pages](./ui-pages) for what players see