# Commands

# Commands

## Player commands

All three commands open the same [achievement book](./ui-pages), each on its own tab.

| Command | Aliases | Opens | Permission (granted by default) |
|---------|---------|-------|---------------------------------|
| `/ksachievements` | `/achievement`, `/ac` | Overview | `ks.achievements.user.use` |
| `/kstitles` | `/title` | Titles tab | `ks.achievements.user.titles` |
| `/ksrewards` | `/reward`, `/rw` | Rewards tab | `ks.achievements.user.rewards` |

The Achievement Book item opens the overview as well (needs `ks.achievements.user.use`).

`/kslang` (your language for all KyuubiSoft mods) comes from KyuubiSoft Core. The language can also be chosen in `/kssettings`.

:::note Removed in 3.0.0
`/kslootbags` and its lootbag window are gone. Lootbag rewards are opened in the **Rewards** tab of the book.
:::

---

## Admin commands

```bash
/ksachievementadmin <subcommand> [args]
/acadmin <subcommand> [args]    # alias
```

Every subcommand needs **`ks.achievements.admin`**. The console can run them as well (except `panel` and `simulate`, which need a player).

| Subcommand | What it does |
|------------|--------------|
| `panel` | Opens the [admin window](./admin-panel) |
| `list <player>` | Lists the player's unlocked achievements |
| `grant <player> <achievement>` | Unlocks the achievement with its rewards, points and title |
| `revoke <player> <achievement>` | Takes the achievement back |
| `simulate <type> [count]` | Sends test trigger events for yourself |

### Players: online and offline

`list`, `grant` and `revoke` accept a player name or UUID. The online player with exactly that name is used first, then the player index of everyone who has joined before. If several offline accounts used the same name, the command asks for the UUID.

For an **offline** player, `grant` and `revoke` are queued and run once at the player's next login. The chat says so.

`grant` and `revoke` run through the players tool of the admin window, so every use appears in its action log and can be reverted there.

### grant

```bash
/acadmin grant Steve spider_hunter_5
```

- Prerequisites are skipped.
- The player gets the rewards, the points and the title, and follow-up achievements react as for a normal unlock.

### revoke

```bash
/acadmin revoke Steve spider_hunter_5
```

- Takes back the points the achievement gave (never below 0) and removes its rewards that were not collected yet. Rewards already collected stay with the player.
- The title of the achievement is removed if the player wears it.
- "Total" achievements need their full count again afterwards.
- With `admin.cascadeRevoke: true`, achievements that require this one are revoked too. With `admin.cascadeRevokeWarning: true` (default) the command names them first for an online player.

### simulate

```bash
/acadmin simulate blocks_mined 100
/acadmin simulate kills 10
```

Sends `count` events (default 1, at most 10,000) of one of these types for yourself: `blocks_mined`, `blocks_placed`, `kills`, `player_kills`, `chat_messages`. Useful to test thresholds on a test server.

---

## Showcase servers

On a server running KyuubiSoft Core's showcase mode, visitors may look around the admin window read-only. `grant`, `revoke`, `simulate` and every save stay blocked for them.

---

## Messages

| Message | Cause |
|---------|-------|
| `Player not found: <name>` | No online player and no known player with that name |
| Several players use this name | Give the UUID instead |
| `Achievement not found` | Unknown id (check the [admin window](./admin-panel) or your files) |
| Already unlocked / not unlocked | The player already has it, or has nothing to revoke |
| Queued for the next login | The player is offline; it runs when they join |