> For the complete documentation index, see [llms.txt](https://lethium.gitbook.io/origin-smp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lethium.gitbook.io/origin-smp/stackmaster/commands-permissions.md).

# Commands and permissions

Every /stackmaster subcommand with its arguments, permission and default, plus the permission nodes for the spawner menu, upgrades and Silk Touch.

One command: **`/stackmaster`**, alias **`/sm`**. Typing it alone lists the subcommands.

## Subcommands

| Command                                    | What it does                                                                                                                                                                  | Permission                     | Default   |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | --------- |
| `/sm reload`                               | Reloads `config.yml` and restarts all three systems.                                                                                                                          | `stackmaster.command.reload`   | operators |
| `/sm stats`                                | Number of stacks and logical size for mobs (`entity`), items (`item`) and spawners (`spawner`).                                                                               | `stackmaster.command.stats`    | operators |
| `/sm stack`                                | Runs a merge pass right now for mobs and items within 16 blocks, and merges spawner stacks within 16 blocks into the biggest one.                                             | `stackmaster.command.stack`    | operators |
| `/sm unstack [amount]`                     | Looking at a spawner (within 5 blocks): takes `amount` spawners off it as items. Otherwise: splits `amount` mobs off the nearest mob stack in your world. Default amount `1`. | `stackmaster.command.unstack`  | operators |
| `/sm inspect`                              | Looking at a spawner (within 6 blocks): mob, size, owner, delay, forced or vanilla mode, location. Otherwise: kind, size and world of the nearest stack.                      | `stackmaster.command.inspect`  | operators |
| `/sm remove`                               | Looking at a spawner (within 6 blocks): deletes the block and its stack, **no items**. Otherwise: removes the nearest mob stack in your world.                                | `stackmaster.command.remove`   | operators |
| `/sm upgrades`                             | Lists the upgrade levels, effects and next costs of the spawner you look at (within 5 blocks).                                                                                | `stackmaster.command.upgrades` | everyone  |
| `/sm upgrade`                              | Same as `/sm upgrades`.                                                                                                                                                       | `stackmaster.command.upgrade`  | everyone  |
| `/sm upgrade <name>`                       | Buys the next level of an upgrade on the spawner you look at.                                                                                                                 | `stackmaster.command.upgrade`  | everyone  |
| `/sm upgrade <name> <level>`               | Sets that level. Players pay for every level up to it. Staff with `stackmaster.upgrade.admin` pay nothing.                                                                    | `stackmaster.command.upgrade`  | everyone  |
| `/sm give <player> <mob> spawner [amount]` | Gives spawner items worth `amount` spawners of that mob (default `1`).                                                                                                        | `stackmaster.command.give`     | operators |
| `/sm debug`                                | Toggles a debug flag. **Off by default** in `config.yml` (`commands.debug.enabled: false`).                                                                                   | `stackmaster.command.debug`    | operators |

Upgrade names: `speed`, `spawn-count`, `chunk-limit`, `activation-range`, `xp`, `drops`. See [Upgrades](/origin-smp/stackmaster/spawners.md#upgrades).

### Notes

* **From the console** only `reload`, `stats`, `give` and `debug` work. The others need a player and answer with the no-permission message.
* **`/sm give`** works from the console. One item holds up to the world's `stacking-spawners.max-stack-size` spawners. A bigger amount gives several items, at most 64 items, so the most you can give at once is `max-stack-size × 64`. The player must be online. The mob must be one that can sit in a spawner (any living mob except players and armour stands). Items that do not fit in the inventory drop at the player's feet.
* **`/sm unstack` on a spawner** takes at most `stacking-spawners.splitting.max-split-size` (32) at once, always leaves one spawner in the block, needs you to be the [owner](/origin-smp/stackmaster/spawners.md#owners), and gives plain items: upgrades stay on the block. It needs `stacking-spawners.splitting.allow-command-split: true`.
* **`/sm unstack` and `/sm remove` on mobs** pick the nearest mob stack anywhere in your world, however far away. Stand next to the stack you mean.
* **`/sm debug`** does not change what is logged. Logging is set in the `debug` section of `config.yml`. See [config.yml](/origin-smp/stackmaster/config-yml.md#debug).
* **While the licence check runs** at startup, every subcommand answers `StackMaster is still starting up. Please wait a moment.` See [Licensing](/origin-smp/getting-started/licensing.md).

## Changing a command's permission or turning it off

Every subcommand has a block under `commands` in `config.yml`:

```yaml
commands:
  stack:
    enabled: true
    permission: "stackmaster.command.stack"
```

| Key                         | What it does                                                                      |
| --------------------------- | --------------------------------------------------------------------------------- |
| `commands.<sub>.enabled`    | `false` turns the subcommand off. It then answers with the no-permission message. |
| `commands.<sub>.permission` | The node checked for this subcommand. Change it to any node you like.             |

A subcommand missing from this section is on and uses `stackmaster.command.<sub>`. The shipped `config.yml` has no `give` block, so `/sm give` is on with `stackmaster.command.give`.

## Other permission nodes

| Node                                   | Default   | What it does                                                                                           |
| -------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------ |
| `stackmaster.spawner.gui`              | everyone  | Open the spawner menu with sneak + right-click.                                                        |
| `stackmaster.upgrade.admin`            | operators | Manage every spawner (break, add, change, upgrade) whoever owns it, and set upgrade levels for free.   |
| `stackmaster.spawner.delay.edit`       | operators | Change the spawn delay in the menu, within `gui.delay-editor.lowest` to `highest` (200 to 2400 ticks). |
| `stackmaster.spawner.delay.bypass`     | operators | Change the spawn delay to anything from 1 to 72000 ticks. Also allows editing on its own.              |
| `stackmaster.spawner.silktouch.bypass` | nobody    | Mine spawners without Silk Touch when `dropping.require-silk-touch` is on.                             |

Changing the spawn **mode** in the menu (Server Default, Always Spawn, Vanilla Rules) needs no node: the owner can always do it.

## What players can do without any node

* Break, add to and place their own spawners, and use the spawner menu.
* Buy upgrades (`stackmaster.command.upgrade` and `.upgrades` default to everyone).
* Split a mob stack with sneak + right-click (`stacking-entities.splitting.allow-player-split`).

## Giving nodes with LuckPerms

```
/lp group default permission set stackmaster.spawner.delay.edit true
/lp group vip permission set stackmaster.spawner.silktouch.bypass true
/lp group admin permission set stackmaster.upgrade.admin true
/lp group default permission set stackmaster.command.upgrade false
```

The last line stops normal players buying upgrades by command. They can still buy them in the menu. To turn upgrades off completely use `stacking-spawners.upgrades.enabled: false`.
