# Shopkeepers Fabric
**Players run their own shops. Place a chest, pick a mob, set your prices, and everyone else buys through the normal villager trading screen.**
Works on **every Minecraft 1.21 release, from 1.21 to 1.21.11.**
> ⚠️ **This is not the official Shopkeepers.** Shopkeepers Fabric is an independent, unofficial mod inspired by the classic [Shopkeepers](https://www.spigotmc.org/resources/shopkeepers.80756/) Bukkit plugin. It is not an official port, it shares no code with the plugin, and it is not made, endorsed or supported by the plugin's authors. Please don't report issues with this mod to them.
## 🎮 No client mod. Your players join vanilla.
Shopkeepers Fabric is **100% server-side**. It goes in your server's `mods/` folder and that's it: no modpack, no launcher setup, nothing for players to install. The trading screen is the vanilla villager screen, the shop editor is a vanilla chest screen, and the shopkeepers are ordinary mobs, so any vanilla client already knows how to show all of it.
## 🏪 Player Shops
Every shop is linked to a **stock chest** (or barrel) placed next to it.
* When someone buys, the item comes **out of the chest** and their payment goes **into it**.
* One shop can mix **selling** (diamonds for emeralds), **buying** (emeralds for wheat) and **swapping** (any item for any item), with up to **45 trades** by default.
* Trades the chest can't fill right now (sold out, or no room for the payment) show the vanilla **red cross**, and the list updates after every purchase.
* **Shift-click** the result to buy as many as you can afford in one go.
* Owners get a chat message whenever someone buys from them.
## 👑 Admin Shops
**Unlimited stock, keeps nothing it's paid.** Made for spawn markets, item sinks and quest rewards.
* Create one with `/shopkeeper admin [mob]`, or switch the Shopkeeper item into admin mode.
* Works from the **console and command blocks**: `/execute positioned 0 64 0 run shopkeeper admin`.
* Only staff can edit or delete them.
## 🛠️ Setting Up a Shop
1. **Craft a Shopkeeper:** 8 emeralds around a chest. It looks like a villager spawn egg (a glowing book on 1.21–1.21.1).
2. **Right-click your chest** with it to select it as stock.
3. **Right-click the air** to choose the mob (optional).
4. **Right-click a block** to place the shop. The editor opens straight away.
### The Editor
A chest screen where each **column is one trade**: what the customer gets on top, the price below, an optional second price under that.
* **Holding an item:** left-click puts in the whole stack, right-click adds 1. Dragging works too.
* **Empty hand:** left-click takes the item out, right-click takes 1 out.
* **The editor only uses copies.** Your real items never leave your inventory, so nothing can be lost or duplicated in it.
* Buttons for **pages, renaming** (type the name in chat, `&` colour codes work), **changing the mob**, the **villager profession and biome look**, and **deleting** the shop (you get the Shopkeeper back).
**25 mobs** to choose from: villagers, wandering traders, pillagers, witches, golems, foxes, cats, pandas, llamas and more. The list is configurable.
## 🔒 Built for Servers (Anti-Grief & Anti-Exploit)
Shopkeepers is designed with server admins in mind. Shops can't be killed, robbed or hijacked.
* **Unkillable shops:** shop mobs ignore all damage, **`/kill @e`**, lightning (no villagers turning into witches), the void and despawning. If anything moves one, it snaps back within a second.
* **Locked stock chests:** only the owner can open or break a shop's chest. **Explosions** leave it standing, and nobody can drain it with a **hopper** or open it by placing a chest next to it to make a **double chest**.
* **No chest hijacking:** you can only use a container **you placed in the last 10 minutes** as stock, so nobody can turn your chest into their shop and lock you out of it.
* **No free items:** stock is checked again at the exact moment an item is taken, so emptying the chest mid-trade can't hand out free items.
* **Shop limits:** 10 shops per player by default, and players can't pass shops to each other to get around it.
* **Crash-proof storage:** shop mobs aren't saved with the world. They're rebuilt from the shop data every time their chunk loads, so a crash or a stray `/kill` can never lose a shop.
* **Clean uninstall:** remove the mod and the shop mobs simply disappear. No stray villagers, no broken entities left behind.
## 🔑 LuckPerms Support
**Every command and action has its own permission node**, and a per-group shop limit can be set as LuckPerms meta. Works with LuckPerms and any other Fabric permissions mod, with nothing extra to install. Without one, it falls back to vanilla op levels.
* Shops for VIPs only: `/lp group default permission set shopkeepers.create false`
* Bigger limits for donors: `/lp group vip meta set shopkeepers.max-shops 25`
* Moderators who can manage any shop: `/lp group mod permission set shopkeepers.bypass true`
A node you set always wins over the default, both ways: you can give a normal player an admin power, or take one away from an op.
### Everyone by default
* `shopkeepers.trade` — Trade with shops.
* `shopkeepers.create` — Create player shops with the Shopkeeper item.
* `shopkeepers.command.list` — `/shopkeeper list` (your own shops).
* `shopkeepers.command.edit` — `/shopkeeper edit`.
* `shopkeepers.command.remove` — `/shopkeeper remove`.
* `shopkeepers.command.transfer` — `/shopkeeper transfer`.
### OP by default
* `shopkeepers.command.list.others` — `/shopkeeper list <player|admin|all>`.
* `shopkeepers.command.give` — `/shopkeeper give`. Without OP, use player names instead of selectors like `@a`.
* `shopkeepers.command.remote` — `/shopkeeper remote`.
* `shopkeepers.command.tp` — `/shopkeeper tp`.
* `shopkeepers.command.reload` — `/shopkeeper reload`.
* `shopkeepers.admin` — Create, edit and delete admin shops.
* `shopkeepers.bypass` — Edit, remove and transfer anyone's shops, and open or break their stock chests. (OPs only get it by default while `opsBypassProtection` is on in the config, which it is unless you change it.)
* `shopkeepers.bypass.limit` — Own more shops than the limit.
* `shopkeepers.bypass.container` — Use any chest as stock, not just one you placed in the last 10 minutes.
### Meta
* `shopkeepers.max-shops` — How many shops a player or group may own (`-1` = unlimited). Replaces the config's default of 10.
Sneak + right-clicking your own shop and the editor's delete button work without the command nodes.
## 📊 Player Commands (everyone)
Leave out the `[id]` to use the shop you're looking at.
* `/shopkeeper list` — Your shops, with their ids and locations.
* `/shopkeeper edit [id]` — Open a shop's editor from anywhere.
* `/shopkeeper remove [id]` — Delete one of your shops and get the Shopkeeper back.
* `/shopkeeper transfer [id] <player>` — Give a shop to another player.
* `/shopkeeper help` — Shows only the commands you're allowed to use.
## 🛠️ Admin Commands (OP, or the matching permission)
* `/shopkeeper list <player|admin|all>` — Anyone's shops, admin shops, or every shop on the server.
* `/shopkeeper give [players] [amount]` — Hand out Shopkeeper items.
* `/shopkeeper admin [mob]` — Create an admin shop where you stand.
* `/shopkeeper remote <id>` — Open any shop's trading screen from anywhere.
* `/shopkeeper tp <id>` — Teleport to a shop.
* `/shopkeeper reload` — Re-read the config file without restarting the server.
Admins can also edit, remove and transfer **any** player's shop, and open any stock chest.
## ⚙️ Configuration
`config/shopkeepers.json` is written with defaults on first run: the shop limit, how far a shop may stand from its chest, trade pages, the allowed mobs, owner trade notifications, and toggles for chest protection, explosion protection and admin bypass. Edit it and run `/shopkeeper reload`, no restart needed. Missing keys fall back to defaults, so your config survives updates.
## 📦 Requirements
* Minecraft **1.21 – 1.21.11** (any 1.21 release)
* Fabric Loader 0.16.0+
* Fabric API
* Java 21
**One jar for every 1.21 release.** Drop it into `mods/` next to Fabric API and it picks the right build for your Minecraft version by itself. Updating Minecraft? Keep the same jar. Shops are stored per world in `world/shopkeepers.dat`, and the items in their trades are upgraded along with the rest of your world.
On 1.21 and 1.21.1 the Shopkeeper item is a glowing knowledge book, because those versions can't give an item the spawn-egg look.
---
**Contact me in my discord server if you need any help**