# Commands

**Version:** 2.0.6

KyuubiSoft Shops registers two commands, plus `/kslang` when it is the first KyuubiSoft mod to load.

| Command | Aliases | Used by | Permission |
|---------|---------|---------|------------|
| `/ksshop` | `shop`, `market` | players | none on the command; each subcommand checks its own node (see below) |
| `/ksshopadmin` | `kssa` | players and console | `ks.shop.admin` on the command and every subcommand |
| `/kslang` | none | players | none |

Typing `/ksshop` or `/kssa` alone prints the list of subcommands.

Shop names are used as you type them, also with commas and brackets (`Tom, Jerry`, `[VIP] Market`). Where a command takes a shop name, put a name with spaces in double quotes: `/ksshop visit "My Shop"`.

:::note[`/ksshop` and Core's NPC shops]
KyuubiSoft Core also registers a `/ksshop` command for its NPC shops. On a server with this plugin, `/ksshop` is always the player shop command described here. Core's NPC shops are opened with `/ksnpcshop open|sell|list` (Core 2.9.0 or newer). See [Shop System](https://wiki.kyuubisoft.com/hytale/shop-system/).
::: Permission nodes are explained on [Permissions](./permissions); the windows are described on [UI Pages](./ui-pages).

---

## Player commands: `/ksshop`

All `/ksshop` subcommands work for players only.

### Windows

| Command | What it does | Node |
|---------|--------------|------|
| `/ksshop browse` | Opens the market on the **Shops** tab. Refused with "The shop directory is disabled on this server." when `features.directory` is `false`. | `ks.shop.user.browse` |
| `/ksshop myshops` | Opens the market on **My shops**. | none |
| `/ksshop myrentals` | Opens the market on **My shops** (your rentals are listed there). | none |
| `/ksshop rentalstations` | Opens the market on **Rental stands**. Falls back to the Shops tab when rental stands are switched off. | none |
| `/ksshop visit <shop>` | Opens a shop's window on the **Buy** tab. `<shop>` is the shop's UUID or its name (not case-sensitive). A closed shop answers "This shop is currently closed." | `ks.shop.user.browse` |
| `/ksshop notifications` | Opens the mailbox on the **Sales** tab, view only (mail can only be claimed at a Mailbox block). Refused when `notifications.enabled` is `false`. | none |

### Information in chat

| Command | What it does | Node |
|---------|--------------|------|
| `/ksshop help` | A short getting-started guide and the command list. | none |
| `/ksshop search <text>` | Lists up to 10 open shops whose name or one of whose item IDs contains the text, with owner (or `[ADMIN]`) and number of offers. | `ks.shop.user.browse` |
| `/ksshop history` | Your last 20 transactions as a customer or as a shop owner: `[BUY]`, `[SALE]`, `[SELL]`, `[BUYBACK]` with amount, price, tax and age. | none |
| `/ksshop stats` | Shops that count toward your limit (of your limit), total revenue, tax paid, number of sales, average rating and unclaimed mails. | none |
| `/ksshop collect` | Tells you how many mails wait and that earnings are claimed at a Mailbox block. It pays nothing out itself. | `ks.shop.user.collect` |

### Managing your shops

Several commands act on "your nearest shop": when you own exactly one shop it is used wherever it stands; otherwise the nearest of your shops in your current world (if none is in this world, the first one found).

| Command | What it does | Node |
|---------|--------------|------|
| `/ksshop create <name>` | Opens a new shop at your position, facing your direction, without a business license. Same cost (`playerShops.creationCost`), shop limit and name rules as the license dialog; the shop gets no category and no description. | `ks.shop.user.create` |
| `/ksshop edit` | Opens the editor of your nearest shop in your current world (packed shops are skipped). Answers "This shop is currently being edited by another session." when someone has its editor open. The in-game help shows `[shopId]`, but the command takes no argument. | `ks.shop.user.edit` |
| `/ksshop open` | Opens your nearest shop again (the name plate loses `[CLOSED]`). | `ks.shop.user.edit` |
| `/ksshop close` | Closes your nearest shop: the merchant stays, its name plate shows `[CLOSED]`, customers get "This shop is currently closed.". | `ks.shop.user.edit` |
| `/ksshop rename <new name>` | Renames your nearest shop. The name must have `nameMinLength` to `nameMaxLength` characters and must not be used by another shop. | `ks.shop.user.edit` |
| `/ksshop deposit <amount>` | Moves gold from your wallet into the till of your nearest shop (the till pays buybacks). | `ks.shop.user.edit` |
| `/ksshop list <days>` | Buys or extends the market listing of your nearest shop. The days are clamped to `listingMinDays`..`listingMaxDays` and added to a running listing. Cost `listingPricePerDay` x days; free with `ks.shop.list.free`, permanent and free with `ks.shop.list.permanent`. Server shops are always listed. | none |
| `/ksshop delete <shop> [confirm]` | Deletes one of your shops in two steps: the first call asks you to repeat it with `confirm` right after the shop within 60 seconds (`/ksshop delete "My Shop" confirm`; `--confirm=confirm` works too). Stock and till go to your mailbox, the merchant disappears, and you get half of the current `creationCost` back. Shops on rental stands cannot be deleted (end the rental in the market instead). Packed shops can be deleted. | `ks.shop.user.delete` |
| `/ksshop transfer <shop> <player>` | Offers one of your shops to another player. The target must be online in your world and gets 60 seconds to answer. Only one open offer per target. Shops on rental stands cannot be transferred ("Shops on rental stands cannot be transferred."), and the target must have room in their shop limit ("Steve already owns as many shops as their limit allows."). | `ks.shop.user.edit` |
| `/ksshop accepttransfer` | Accepts the offer: the shop, its stock, till and rating are yours. The shop limit is checked again; when it is full by then, the offer is dropped with "You have reached the maximum number of shops (3)!". | none |
| `/ksshop declinetransfer` | Declines the offer. | none |

### Ratings and rentals

| Command | What it does | Node |
|---------|--------------|------|
| `/ksshop rate <shop> <1-5>` | Rates a shop with 1 to 5 stars. It follows the same rules as the **Reviews** tab of the shop window: not while ratings are switched off ("Ratings are disabled on this server."), not your own shop, stars within the configured range, and a changed rating only after `ratings.cooldownMinutes` ("You can change your rating of this shop again in 42 min."). The command has no comment argument; a comment you already wrote is kept. | `ks.shop.user.rate` |
| `/ksshop releaserental <slotId>` | Ends one of your rentals early, like **End rental** in the market. `<slotId>` is the stand's UUID. Stock and till go to your mailbox. | none |

---

## Admin commands: `/ksshopadmin` (`/kssa`)

Every subcommand requires `ks.shop.admin`. Answers come in the sender's language (the console gets the server's default language). Commands marked "player" need a player because they use your position or open a window.

On a server that runs KyuubiSoft Core's showcase mode, every subcommand that changes something answers "no permission" unless you are a real admin. `stats`, `log`, `listrentals`, `blacklist list` and the console are not affected.

### Window and server shops

| Command | Sender | What it does |
|---------|--------|--------------|
| `/kssa admin` | player | Opens the Shop Admin window on **All shops**. See [Admin Panel](./admin-panel). |
| `/kssa createadmin <title>` | player | Creates a server shop (no owner, always listed) at your position, facing your direction. The title follows the name rules (`nameMinLength`..`nameMaxLength`, unique). Refused when `features.adminShops` is `false`. |
| `/kssa editadmin` | player | Opens the editor of the nearest server shop in your world (free rental stands are skipped). |
| `/kssa deleteadmin <shopId>` | any | Deletes a server shop and its merchant. `<shopId>` is the UUID or the `id` of a template file (for example `blacksmith`). A template shop deleted in game stays deleted until its file changes. |

### Player shops

| Command | Sender | What it does |
|---------|--------|--------------|
| `/kssa deleteplayer <shopId>` | any | Deletes a player shop: stock and till go to the owner's mailbox. For a shop on a rental stand the rental ends instead (the stand stays and is free again). Refused while someone has the shop's editor open. |
| `/kssa deletenpc` | player | The same delete for the player shop whose position is closest to you, within 5 blocks. |
| `/kssa closeplayer <shopId> [reason]` | any | Closes any shop like `/ksshop close`. The reason (default "Admin action") can be several words and is shown as typed, only in your confirmation; the owner is not told. `--reason=<text>` works too. |
| `/kssa openplayer <shopId>` | any | Opens a shop again; a merchant that is missing is spawned again. |
| `/kssa feature <shopId>` | any | Features a shop for `featured.durationDays` days (default 7): it is listed first when the market sorts by rating and carries a "Featured" chip. Ending a feature early is done in the admin window. |

`<shopId>` must be the full UUID here. The admin window shows only the first 8 characters, but it offers the same open, close, feature and delete actions without typing an ID.

### Economy, data and tools

| Command | Sender | What it does |
|---------|--------|--------------|
| `/kssa settax <rate>` | any | Sets the buy and the sell tax to `rate` x 100 percent (`0.05` = 5 %). `0` switches taxes off, anything above 0 switches them on. A rate outside 0 to 1 answers "The tax rate must be between 0.0 and 1.0.". Saved to `config.json`. |
| `/kssa stats` | any | Shops (server, player, rental), open and featured shops, total revenue, taxes collected, active merchants. |
| `/kssa log <player>` | player | Opens the admin window on **Transactions**, searching for that player (part of the name is enough). |
| `/kssa blacklist add <itemId>` | any | Blocks an item ID from being put into player shops. The item must exist in the game. `--itemId=<id>` works too. |
| `/kssa blacklist remove <itemId>` | any | Allows it again. |
| `/kssa blacklist list` | any | Lists the blocked IDs. |
| `/kssa reload` | any | Reloads `config.json`, the language files and the market index. Scheduled tasks (rental expiry, rent collection, Shop of the Week, look-at-player) keep their start-up setting until a restart. |
| `/kssa respawnnpcs` | player | Despawns and respawns the merchants of every shop in your current world from the saved shop data: player shops, rented and free stands and server shops. Packed shops are skipped (they have no merchant). Leftover copies of shop merchants are removed. |

### Rental stands

| Command | Sender | What it does |
|---------|--------|--------------|
| `/kssa createrental <name> [pricePerDay] [maxDays]` | player | Creates a fixed-price stand at your position. Missing values come from `rentalStations.defaultPricePerDay` / `defaultMaxDays`. Prints the stand's UUID. |
| `/kssa createrentalauction <name> [minBid] [bidIncrement] [durationMinutes] [rentalDays]` | player | Creates an auction stand and starts its first round at once. Missing values come from `defaultMinBid`, `defaultBidIncrement`, `defaultAuctionDurationMinutes`, `defaultMaxDays`. |
| `/kssa listrentals` | player | Lists the stands of your current world: name, mode, state (free, auction with high bid, rented by whom and for how long) and UUID. |
| `/kssa forceexpirerental <slotId>` | any | Ends a running rental now: stock and till go to the renter's mailbox, the renter is told, the stand is free again (an auction stand starts a new round only with `onEmptyAuction` = `RESTART`). |
| `/kssa deleterental <slotId>` | any | Deletes a stand and its merchant. A running rental is ended first (stock and till to the renter's mailbox). |

The stand name is one word; put a name with spaces in double quotes (it is saved without the quotes). The numbers follow in the order shown, as plain numbers or by name (`--pricePerDay=100`). A word that is no number, or too many words, creates nothing and shows the usage. Names can also be changed in the admin window.

---

## `/kslang`

| Usage | What it does |
|-------|--------------|
| `/kslang` | Answers in chat with your current language (and whether it is auto-detected), the available codes and how to change it. |
| `/kslang <code>` | Sets your language, for example `/kslang de-DE`. |
| `/kslang auto` | Removes your choice; your client language is used again. |

The choice is shared by all KyuubiSoft mods (`mods/kslang/`).

---

## Examples

### Open a shop by command and list it for a week

```
/ksshop create Food Corner
/ksshop edit
   (drag bread and apples into the shop, set "Sell to customers" prices, Save)
/ksshop list 7
```

### Run an auction for a plaza stand

```
/kssa createrentalauction Plaza 1000 50 60 14
   minimum bid 1000, step 50, 60-minute auction, the winner rents for 14 days
```

### Clear a stand for an event

```
/kssa listrentals
   (copy the stand's id)
/kssa forceexpirerental <id>
   -> the renter gets stock and till in the mailbox, the stand is free
```

### Look up a player's trades

```
/kssa log Steve
```