# Shop System

# Shop System

> **Mod:** part of KyuubiSoft Core (`KyuubiSoftCore-2.9.9.jar`) | **Version:** Core 2.9.9 | **Config:** `mods/kyuubisoft_core/shops/`

The Shop System runs the server-owned **NPC shops** of KyuubiSoft Core. Players buy and sell at merchant NPCs or with a command, and pay with quest tokens, achievement points, the server economy or any item. Shops are JSON files, and admins can also build and edit them in game with the shop editor.

:::note[NPC shops vs. player shops]
This page is about Core's NPC shops. Player-run shops, shop blocks and rentals come from the separate [Player Shops](https://wiki.kyuubisoft.com/hytale/player-shops/) mod, which owns the `/ksshop` command. Core's NPC shops use **`/ksnpcshop`**.
:::

## What's new in Core 2.8 and 2.9

- **New shop window** in the KS Premium look: "Buy" and "Sell" tabs, category pills, 3×3 offer cards and a detail panel with today's limit, how many you already own, a quantity stepper and the total. The sell tab lists per-piece prices, daily sell limits and "Sell all".
- **In-game shop editor** (2.9.0) in the `/ksadmin` hub, tile **NPC Shops**: search, templates, copies, a price tool, a player preview and NPC links. See [Shop Editor](https://wiki.kyuubisoft.com/hytale/shop-system/admin-panel/).
- **New shop options:** a header `icon`, `openVia` (`any`, `npc` or `command`), a working `allowBuyMultiple`, entries that can be switched off (`enabled: false`) and an editor display name per entry.
- **Own command:** `/ksnpcshop open|sell|list`. Before, Core used `/ksshop`, which clashed with the Player Shops mod.
- **Safer purchases:** an item is only charged when it fits into the inventory, a command that cannot run is refused before paying, and a command that fails while running is refunded.

:::caution
The new shop window and the shop editor have not been tested on a live server yet.
:::

## Features

- **Multiple Currencies** — Quest tokens, achievement points, the server economy (`economy`) or any item (`item:<ItemId>`)
- **JSON Configuration** — Define offers, prices and categories in config files
- **NPC Integration** — Open shops at a merchant NPC, through a dialog answer or by command
- **Buy & Sell** — Players buy offers and sell items back for currency
- **Purchase Limits** — Optional purchase and sell limits per item per day
- **Daily Rotation** — Every player gets their own daily pick, drawn by weight
- **Command Purchases** — Run a command instead of handing out an item
- **Custom Shops** — Add your own shops next to the shipped ones
- **In-Game Shop Editor** — Create, copy, edit and delete shops without editing JSON

## Quick Start

1. The Core mod includes the shop system — no extra installation needed.
2. Shop files are in `mods/kyuubisoft_core/shops/`.
3. Use `/ksnpcshop open <shopId>` to open a shop in game.
4. Use `/ksnpcshop list` to see all shops.
5. Edit shops in the shop editor (`/ksadmin` → **NPC Shops**), or edit the JSON files and run `/ksadmin reload`.

## Commands

| Command | Description |
|---------|-------------|
| `/ksnpcshop open <shopId>` | Open a specific shop |
| `/ksnpcshop sell <shopId>` | Open a shop on its "Sell" tab |
| `/ksnpcshop list` | List all shops |

On servers without the Player Shops mod, the old `/ksshop open|sell|list` still works the same way.

## Documentation

<DocCardList />