# Utility Commands

Convenience and admin commands: healing, flying, god mode, inventory management and info commands. Cooldowns and costs are configurable per command in `modules/utility.yml`.

## Health & status

| Command | Syntax | Permission (self) | Permission (others) | Default | Description |
|---|---|---|---|---|---|
| `/heal` | `/heal [player]` | `util.heal` | `util.heal.others` | `false` | Heal fully and extinguish fire |
| `/feed` | `/feed [player]` | `util.feed` | `util.feed.others` | `false` | Fill hunger and saturation |
| `/god` | `/god [player]` | `util.god` | `util.god.others` | `false` | Toggle invulnerability (persists with `god-persist`) |
| `/fly` | `/fly [player]` | `util.fly` | `util.fly.others` | `false` | Toggle flight mode (not persisted) |
| `/speed` | `/speed <value> [player]` | `util.speed` | `util.speed.others` | `false` | Walk/fly speed 0 to 10 (1 = normal) |

## Game mode

| Command | Syntax | Permission (self) | Permission (others) | Default | Description |
|---|---|---|---|---|---|
| `/gamemode` | `/gamemode <mode> [player]` (alias `/gm`) | `util.gamemode` | `util.gamemode.others` | `false` | Set game mode (`survival`/`s`/`0`, `creative`/`c`/`1`, `adventure`/`a`/`2`, `spectator`/`sp`/`3`) |
| `/gmc` `/gms` `/gma` `/gmsp` | `/gmc [player]` etc. | `util.gamemode` | `util.gamemode.others` | `false` | Shortcuts for the four modes |

## Inventory & items

| Command | Syntax | Permission (self) | Permission (others/all) | Default | Description |
|---|---|---|---|---|---|
| `/repair` | `/repair [all\|hand]` (alias `/fix`) | `util.repair` | `util.repair.all` | `false` | Repair the item in hand, with `all` the whole inventory |
| `/hat` | `/hat` | `util.hat` | - | `false` | Swap item into the helmet slot (even with a helmet on) |
| `/clear` | `/clear [player]` (alias `/ci`) | `util.clear` | `util.clear.others` | `false` | Clear inventory |
| `/clearenderchest` | `/clearenderchest [player]` (alias `/clearec`) | `util.clearenderchest` | `util.clearenderchest.others` | `false` | Clear ender chest |
| `/ec` | `/ec` (alias `/enderchest`) | `util.ec` | - | `true` | Open your own ender chest virtually |
| `/invsee` | `/invsee <player>` | `util.invsee` | - | `false` | View/edit another inventory |
| `/endersee` | `/endersee <player>` (alias `/ecsee`) | `util.endersee` | - | `false` | View/edit another ender chest |
| `/exp` | `/exp <give\|take\|set> <player> <amount>` (alias `/xp`) | - | `util.exp` | `false` | Manage XP levels using the Minecraft formula |
| `/hunger` | `/hunger <player> <value>` | - | `util.hunger` | `false` | Set food level (0 to 20) |

## Virtual workbenches

| Command | Syntax | Permission | Default | Description |
|---|---|---|---|---|
| `/workbench` | `/workbench` (alias `/craft`, `/wb`) | `util.workbench` | `true` | Virtual crafting table |
| `/anvil` | `/anvil` | `util.anvil` | `true` | Virtual anvil |
| `/trash` | `/trash` (alias `/disposal`) | `util.trash` | `true` | Disposal inventory (contents deleted on close) |

More workstations are bundled in the [Stations](stations.html) module with its hub GUI.

## Info commands

| Command | Syntax | Permission | Default | Description |
|---|---|---|---|---|
| `/near` | `/near [radius]` | `util.near` | `true` | Nearby players sorted by distance (vanished players hidden) |
| `/ping` | `/ping [player]` (alias `/latency`) | `util.ping` | `true` | Latency, color coded; others: `util.ping.others` |
| `/tps` | `/tps` | `util.tps` | `false` | TPS of the last 1/5/15 minutes plus MSPT |
| `/list` | `/list` (alias `/online`, `/who`) | `util.list` | `true` | Online players, sorted by group with LuckPerms |
| `/whois` | `/whois <player>` (alias `/playerinfo`) | `util.whois` | `false` | UUID, health, location, game mode, level; IP only with `util.whois.ip` |
| `/seen` | `/seen <player>` (alias `/lastseen`) | `util.seen` | `true` | Last online time (offline players too) |

> **Tip:** `/trash` is the safe item disposal without lava or fall damage.

## Configuration (modules/utility.yml)

```yaml
# Enables or disables the utility module.
enabled: true

utility:
  # Persists god mode across restart/reload.
  god-persist: true
  # Default and maximum search radius for /near in blocks.
  near-default-radius: 200
  near-max-radius: 500
  # Disables individual commands without disabling the module.
  # Example: ["heal", "repair", "anvil"]
  disabled-commands: []

cooldown:
  commands:
    # Seconds per command. 0 = no cooldown. For unlisted commands
    # (e.g. ec, hat, exp) just add an entry with the command name.
    heal: 0
    feed: 0
    repair: 0
    workbench: 0
    anvil: 0
    trash: 0
    near: 0

cost:
  commands:
    # Price per command. 0 = free.
    heal: 0
    feed: 0
    repair: 0
    workbench: 0
    anvil: 0
```

## Complete example config

```yaml
enabled: true

utility:
  god-persist: false
  near-default-radius: 100
  near-max-radius: 250
  disabled-commands:
    - hunger

cooldown:
  commands:
    heal: 300
    feed: 120
    repair: 600
    workbench: 0
    anvil: 0
    trash: 0
    near: 30

cost:
  commands:
    heal: 50.0
    feed: 25.0
    repair: 200.0
    workbench: 0
    anvil: 0
```
