ShopShelves - 管理员商店与玩家自有商店
使用的是 Bukkit、Spigot、Paper 或 Purpur?
插件版本的说明/相关信息可在 SpigotMC 页面找到。
ShopShelves 将 货架方块(Shelf Block) 变成了交互式、对服务器友好的展示商店!管理员可以创建永久性的固定价格商店,而玩家可以设置与箱子链接的 玩家货架(Player Shelves) 并自定义价格,所有交易均由 EcoBal 经济系统驱动。价格、库存和商店状态通过低延迟的文本显示(Text Displays)实时呈现,店主会收到每笔销售的通知。
也想进行物品对物品的交易吗?试试 TradeShelves,它基于相同的交互和保护系统构建,并与 ShopShelves 完全兼容。然后再搭配客户端模组 WIITS 让购物体验更佳!

图片说明:
以下图片按顺序展示了游戏内的货架方块:
购买商店 | 出售商店 | 买卖双向商店 | 自定义标签 | 玩家商店
统计书 → 显示每个物品槽位赚取的总金钱 / 损失的总金钱。
自定义价格 GUI → 按住 Shift 右键点击你的货架即可为每个槽位设置自定义价格。
面向客户的查看器 GUI,用于检查完整物品(药水、附魔等)。


📧 联系我与支持信息
💬 主要支持渠道(推荐)
所有一般性问题、功能请求和非紧急的错误报告,请发布在我们的 Discord 服务器 的相应频道中。 我们会积极监控服务器并尽快回复。这确保了整个社区都能从讨论和解决方案中受益。
🆘 紧急私聊 (PM) 政策
虽然我们倾向于所有问题都先通过 Discord 服务器处理,但在特定的紧急情况下,欢迎直接私聊我:
- 允许的原因: 您的服务器因我的某个模组/插件直接导致崩溃或出现关键的、破坏游戏的错误。
- 要求: 您必须是该服务器的所有者。
- 时区: 我处于 (CET/CEST) 时区。
- 私聊时间: 请在 上午 10:00 到晚上 10:00(布鲁塞尔时间) 之间发送私聊消息。
我会尽力尽快回复您的私聊以提供有帮助的建议,并看看我能做些什么来解决您的紧急问题。但是,请理解无法保证立即回复,且私聊是一种职业礼仪,而非一种权利。感谢您的理解与合作!
必需模组:EcoBal Economy API
✨ 特性与亮点
原生商店方块
- 使用 货架方块(Shelf Block) 本身作为商店:无需告示牌,无需盔甲架,外观干净且沉浸感强。
双模式商店
- 管理员商店(购买 / 出售 / 双向): 具有无限库存的永久性商店,用于购买、出售或两者兼有。管理员商店不受世界白名单的限制。
- 玩家商店(玩家货架): 玩家通过在箱子、 barrels 或铜箱旁潜行 + 放置一个货架方块来创建自己的商店。
- 自动链接到容器,包括大型箱(double chests),以便管理库存。
- 通过游戏内价格 GUI 为每个槽位设置自定义价格。
- 可选的单类型模式(
limit_playershelf_to_single_type):三个槽位均为同一种物品并共享价格,或者每个槽位有不同的物品和价格。
- 当链接的容器缺失时,显示不可用(Out of Order)。
- 当链接的容器被破坏时,货架会重置为普通的原版货架,不会留下悬浮的文本或过时的数据。
- 即使所有者离线,其名字仍会保留在商店显示上。
所有者通知
- 销售通知: 店主会收到在其商店进行的每一笔销售和购买的邮件。离线期间产生的销售会在他们上线时汇总显示。
- 缺货通知: 当商店库存耗尽时,店主会收到通知,包含物品名称和货架坐标。
- 随时使用
/shops list 和 /shops outofstock 打开列表查看。
价格 GUI
- 店主按住 Shift + 右键点击货架即可打开完整的价格管理 GUI:使用 +/- 按钮调整每个槽位的购买/销售价格,或在聊天中输入确切数值(及数量)。无需使用命令。
- 一键将任何槽位重置为全局配置价格。
- 聊天输入在 60 秒后过期;输入
cancel 取消操作。
购买确认
- 可选功能(
confirm_transactions):第一次点击会显示你将购买或出售的物品及金额,在同一槽位上的第二次点击确认交易。
自定义商店标签
- 通过价格 GUI 中的名称标签按钮设置个性化浮动标签:左键点击在聊天栏中输入,右键点击移除。
- 支持 颜色代码(
&c, &l, …)、十六进制颜色(&#RRGGBB)以及 第二行文本(\n 或 &n)。颜色支持可按权限单独授予。
label_max_length 仅计算可见字符数。括号和颜色的配置可针对管理员商店和玩家商店分别设置,并提供一个 brackets_per_line 切换选项。
商店查看器与统计信息
- 顾客按住 Shift + 点击货架顶部边缘 即可打开只读查看器,显示所有商品详情(包括药水、附魔等)。
- 统计书 显示每个槽位赚取的总金钱和损失的总金钱。它存储在货架上,因此重启后数据不会丢失。
灵活的定价系统
- 全局价格: 在
pricing.yml 中或通过 /shops itemprice 命令为任何物品设置默认价格,包括药水、附魔书、山羊号角、玩家头颅等。
- 自定义价格印章: 使用
/shops price 将一次性价格标记到手持物品上,然后将其放置到货架上。
- 单槽位控制: 每个槽位都可以拥有独立的买入价、卖出价和堆叠数量(例如:$10 购买 64 个泥土)。
低延迟文本显示
- 价格、库存和状态使用 Minecraft 的 Text Display Entity(文本显示实体) 展示:无需数据包黑客手段,也无需旧版全息图。它们仅在内容实际发生变化时重建,并减少向客户端同步的频率。
- 可配置缩放: 独立调整标题、数量和价格显示的尺寸(1–10)。
- 视距范围: 商店标题和价格标签拥有独立的渲染距离。
- 两种价格显示模式:
TRIPLEPRICE(每槽位一个价格)或 SINGLEPRICE(合并为一个总价)。
- 物品语言: 使用任意 Minecraft 区域设置(
en_us, de_de, fr_fr, …)本地化物品名称。
Web 地图标记
- 商店会显示在 BlueMap、Dynmap 和 squaremap 上,包含所有者/标签信息以及在售商品。当安装了上述任一模组时自动生效(需在
config.yml 中配置 web_map)。
基岩版支持 (Geyser / Floodgate)
- 基岩版玩家可以 潜行 + 点击货架上半部分 来打开商店查看器,查看每个商品下方的买入和卖出价格,并在价格 GUI 中使用纸张代替右键操作。Java 版玩家不受影响。
翻译
- 在
config.yml 中设置 language。每种语言都有对应的 messages_<language>.yml 文件,你的修改会被保留,帮助页面也会进行翻译。
保护与安全
- 关联的容器只能由其所有者或管理员打开或破坏。
- 商店货架及其关联的容器对 爆炸、凋灵 和 火焰 免疫;漏斗、漏斗矿车 和 铜傀儡 无法从活跃商店中取出物品或放入物品(
container_protection)。
- 交易绝不会导致物品或金钱丢失:无法容纳的物品会被掉落,失败的交易会退款。
- 正面物品槽位不会被意外破坏:所有者和管理员需击中货架的顶部或底部边缘才能破坏货架。
商店管理
- 玩家商店上限: 通过权限(如
shopshelves.playershelves.5)限制每位玩家的货架数量,或授予无限权限。
- 世界白名单: 使用
allowed_worlds 或在游戏内使用 /shops worlds 将玩家商店限制在特定世界中。管理员可以授予按世界限制的权限或全局绕过权限。
- 管理员模式:
/shops admin 允许操作员绕过所有限制并设置商店。
- 可点击的帮助菜单:
/shops 打开一个带有可点击命令的帮助菜单,无需经过“确认命令执行”界面。
- 更新检查器: 拥有
shopshelves.update 权限的玩家会在 Modrinth 上有更新的 Fabric 版本时收到通知。
- 配置自动迁移: 更新时会自动添加新的
config.yml 和 messages.yml 键值,并保留你的注释。
专为与 TradeShelves 协作而设计
安装 TradeShelves 并与 ShopShelves 并存,两者将在启动时互相检测并协同工作:
- 一副货架,双手分工: 使用 主手 制作的玩家商店成为 ShopShelves 商店,使用 副手 制作的玩家商店成为 TradeShelves 交易架(可通过
TradeShelves_offhand 交换)。管理员商店继续使用各自模组的管理员模式。
- 同一箱子上的金钱与交易: 所有者可以将 ShopShelves 商店和 TradeShelves 交易架放在同一个箱子上。其他玩家不能使用已链接到他人商店的箱子。
- 一次重载:
/shops reload 或 /trades reload 同时重载两个模组,ShopShelves 优先加载。
- 共享权限与限制: 可选地让 TradeShelves 使用 ShopShelves 的权限节点和玩家商店限制(见下方兼容设置)。
- ShopShelves 始终拥有优先级,且两个模组互不干涉对方的货架。
⚙️ 设置与用法
1. 管理员商店设置
- 放置 一个货架方块。
- 进入管理员模式: 运行
/shops admin。
- 设置模式: 潜行状态下,右键点击货架中间 以循环切换 NONE → BUY → SELL → DUAL。
- 设置物品与价格: 手持一个物品(已配置全局价格,或使用价格印章),右键点击一个槽位以填充它。
- 价格 GUI: 潜行 + 右键点击货架的顶部或底部边缘。
2. 玩家商店设置
- 放置 一个箱子、 barrel(木桶)或铜箱。
- 链接货架: 潜行状态下,将货架方块放置在容器旁边。货架将自动链接。如果安装了 TradeShelves,请使用你的 主手(如果服务器交换了手则使用副手)。
- 设置价格: Shift + 右键点击 你的货架以打开 价格 GUI。
- 上架商品: 将物品添加到关联的容器中。显示将自动更新。
3. 顾客交互
- 右键点击槽位: 购买一叠物品。
- 左键点击槽位: 卖出一叠物品。
- 潜行 + 点击(管理员商店): 一次性购买或卖出一整叠物品。
- Shift + 点击顶部边缘: 打开只读商店查看器。
- 基岩版: 潜行 + 点击货架上半部分以打开商店查看器。
命令
/shops, /shopshelves: 打开包含可点击命令的帮助菜单。
/shops help admin: 打开管理员帮助页面。
/shops list (/shops sales): 显示你在商店中收集的销售额。
/shops outofstock (/shops stock): 显示你库存耗尽的商店。
/shops admin [player]: 为自己或其他玩家切换管理员设置模式。
/shops reload: 重新加载 config.yml、pricing.yml 和 messages.yml 并刷新显示界面。如果安装了 TradeShelves,也会重新加载该模组。
/shops update: 强制刷新所有商店文本显示。
/shops worlds [add|remove] <world>: 查看或更改玩家商店的世界白名单。
/shops mode [mode]: 查看或设置 消息发送模式 (CHAT | ACTIONBAR | BOTH) 或 价格显示模式 (SINGLEPRICE | TRIPLEPRICE)。
/shops itemprice [price] [buy|sell|both] [amount]: 查看或设置手中物品的全局价格。
/shops price <price> [buy|sell|both] [amount]: 为手中物品盖上一个自定义的一次性价格印章。你的背包中同一时间只允许存在一个带有价格印章的物品。
权限
点击查看所有权限节点及其描述
shopshelves.command: 使用 /shops、帮助页面、/shops list 和 /shops outofstock 的权限。(默认:所有玩家)
shopshelves.admin: 使用 /shops admin 的权限。(OP 等级 2)
shopshelves.reload: 使用 /shops reload 的权限。(OP 等级 2)
shopshelves.update: 使用 /shops update 以及在加入游戏时接收更新通知的权限。(OP 等级 2)
shopshelves.mode: 使用 /shops mode 的权限。(OP 等级 2)
shopshelves.itemprice: 使用 /shops itemprice 管理全局价格的权限。(OP 等级 2)
shopshelves.price: 使用 /shops price 创建价格印章的权限。(默认:所有玩家)
shopshelves.worlds: 使用 /shops worlds 管理世界白名单的权限。(OP 等级 2)
shopshelves.playershelf: 允许玩家创建玩家货架的权限。(默认:所有玩家)
shopshelves.playershelves.<number>: 设置玩家货架的最大数量(例如 shopshelves.playershelves.10)。(OP 等级 2)
shopshelves.playershelves.unlimited: 授予无限玩家货架的权限。(OP 等级 4)
shopshelves.playershelf.worlds: 绕过所有世界的世界白名单限制。(OP 等级 4)
shopshelves.playershelf.<world>: 绕过特定世界的世界白名单限制。(OP 等级 4)
shopshelves.setlabel: 允许通过价格 GUI 设置自定义商店标签的权限。(OP 等级 2)
shopshelves.setlabel.color: 允许在自定义商店标签中使用颜色/格式化代码的权限。(OP 等级 4)
通过 Fabric Permissions API 与 LuckPerms 配合工作。如果没有安装权限模组,则使用上述 OP 等级作为权限控制。
兼容设置
ShopShelves config.yml 中的这些设置仅在安装了 TradeShelves 时才生效。ShopShelves 具有优先级,因此由它接管这些设置。
# ─── 兼容设置 (仅在安装 TradeShelves 时使用) ───
# true: ShopShelves 玩家商店使用主手,TradeShelves 玩家商店使用副手。
# false: 反之亦然。
TradeShelves_offhand: true
# true: TradeShelves 使用 ShopShelves 的权限节点 (tradeshelves.X = shopshelves.X)。
TradeShelves_permissions: false
# true: TradeShelves 使用此配置文件中的默认玩家商店上限。
TradeShelves_ownlimit: false
共享权限: 当 TradeShelves_permissions: true 时,每个 tradeshelves.X 节点都会作为 shopshelves.X 进行检查(例如 shopshelves.playershelf、shopshelves.playershelves.5),并且 tradeshelves.arrow 对应 shopshelves.mode。
🛠️ 开发者 API: ShopshelvesApi
对于模组开发者,ShopShelves 通过 me.andy.shopshelves.api.ShopshelvesApi 暴露了商店货架的功能。
ShopshelvesApi api = ShopshelvesApi.getInstance();
// 检查某个方块实体是否为任意类型的活跃商店
boolean isShop = api.isShopShelf(blockEntity);
// 商店模式:BUY, SELL, DUAL 或 PLAYERSHELF
Optional<ShopHelper.ShopMode> mode = api.getShopMode(blockEntity);
// 玩家拥有货架的所有者 UUID
Optional<UUID> owner = api.getShopOwner(blockEntity);
事件
监听 me.andy.shopshelves.api.ShopShelvesEvents(Fabric API 事件)。返回 false 以取消操作;每个事件都在服务器线程上触发,且在发生任何更改之前执行。
// 即将创建商店
ShopShelvesEvents.SHOP_CREATE.register((player, world, pos, mode) -> true);
// 即将移除商店(被破坏或切换回 NONE)
ShopShelvesEvents.SHOP_REMOVE.register((player, world, pos, previousMode) -> true);
// 即将进行购买或销售,在任何金钱或物品移动之前
ShopShelvesEvents.TRANSACTION.register((player, world, shelfPos, owner, item, amount, price, type) -> true);
使你的货架模组兼容
ShopShelves 和 TradeShelves 会保留其他模组已占用的货架不受干扰。在 Fabric 平台上,每个货架模组都将其自己的接口混入 ShelfBlockEntity,因此请将以下方法之一添加到 你的 mixin 接口中:
boolean isShelfClaimed(): 当货架属于你时返回 true。这是最简单的选项。
getShopMode(): 返回枚举或字符串,除 NONE 之外的任何值均可。
public interface MyShelf {
// ShopShelves / TradeShelves 会忽略所有返回 true 的货架
default boolean isShelfClaimed() {
return isMyShelfActive();
}
boolean isMyShelfActive();
}
当你的货架变回普通货架时,请返回 false(或 NONE),我们的模组将把它视为普通货架处理。
依赖
整合包政策
- 你可以将 ShopShelves 包含在任何整合包中。
- 署名是受欢迎的,但并非严格要求。
- 请勿直接修改该模组的 JAR 文件。
- 整合包本身,或通过该整合包访问此模组的方式,不得出售。
ShopShelves - Admin Shops & Player-Owned Shops
Using Bukkit, Spigot, Paper or Purpur?
The plugin version description / relevant information can be found on the SpigotMC page.
ShopShelves turns the Shelf Block into interactive, server-friendly display shops! Admins create permanent fixed-price shops, and players set up their own chest-linked Player Shelves with custom prices, all powered by the EcoBal economy. Prices, stock and shop status are shown live with lag-friendly Text Displays, and owners get notified of every sale.
Want item-for-item trades too? Check out TradeShelves, built on the same interaction and protection system and fully compatible with ShopShelves. Then make shopping even better with the WIITS client side mod!

Pictures explained:
The following pictures depict the in-game shelf blocks in order:
Buy Shop | Sell Shop | Buy & Sell Shop | Custom Label | Player Shop
Statistics Book → Shows the total money earned / lost per item slot.
Custom Price GUI → Shift right-click your shelf to set custom prices per slot.
Customer-friendly viewer GUI to inspect the full item (potions, enchantments, etc.)


📧 Contact Me & Support Information
💬 Primary Support Channel (Preferred)
All general questions, feature requests, and non-urgent bug reports should be posted in the appropriate channels on our Discord Server. We actively monitor the server and will respond as soon as possible. This ensures that the whole community can benefit from the discussion and solutions.
🆘 Urgent Private Messaging (PM) Policy
While we prefer all issues to be handled via the Discord server first, you are welcome to PM me directly under specific urgent circumstances:
- Allowed Reason: Your server is crashing or experiencing critical, game-breaking errors directly related to one of my mods/plugins.
- Requirement: You must be the owner of the server.
- Time Zone: I am operating in the (CET/CEST) Time Zone.
- PM Hours: Please only send private messages between 10:00 AM and 10:00 PM (Brussels Time).
I will endeavor to answer your PM as soon as I can to be helpful and see what I can do to resolve your urgent issue. However, please understand that immediate responses are not guaranteed, and private messaging is a professional courtesy, not an entitlement. Thank you for your understanding and cooperation!
Required Mod: EcoBal Economy API
✨ Features & Highlights
Native Shop Block
- Uses the Shelf Block as the shop itself: no signs, no armor stands, just a clean, immersive look.
Dual Shop Modes
- Admin Shops (Buy / Sell / Dual): Permanent shops with infinite stock for buying, selling, or both. Admin shops are never restricted by the world allowlist.
- Player Shops (Player Shelves): Players create their own shop by sneaking + placing a Shelf Block against a chest, barrel or copper chest.
- Automatically links to the container, including double chests, for stock management.
- Custom prices per slot via the in-game Price GUI.
- Optional single-type mode (
limit_playershelf_to_single_type): one item type across all three slots with a shared price, or a different item and price per slot.
- Shows Out of Order when the linked container is missing.
- When the linked container is broken, the shelf resets to a plain vanilla shelf, with no leftover floating text or stale data.
- The owner's name stays on the shop display while they are offline.
Owner Notifications
- Sale notifications: owners get a message for every sale and purchase at their shops. Sales made while they were offline are added up and shown when they join.
- Out-of-stock notifications: owners are told when a shop runs out of stock, with the item and the shelf coordinates.
- Open the lists any time with
/shops list and /shops outofstock.
Price GUI
- Owners shift + right-click their shelf to open a full price management GUI: use +/− buttons to adjust buy/sell prices per slot, or type an exact value (and amount) in chat. No commands required.
- Reset any slot back to the global config prices with one click.
- Chat input expires after 60 seconds; type
cancel to stop.
Purchase Confirmation
- Optional (
confirm_transactions): the first click shows what you would buy or sell and for how much, a second click on the same slot confirms it.
Custom Shop Labels
- Set a personalized floating label from the Price GUI with the name tag button: left-click to type it in chat, right-click to remove it.
- Supports color codes (
&c, &l, …), hex colors (&#RRGGBB) and a second line (\n or &n). Color support can be granted per permission.
label_max_length counts only visible characters. Brackets and colors are configurable separately for admin and player shops, with a brackets_per_line toggle.
Shop Viewer & Statistics
- Customers shift + click the top edge of a shelf to open a read-only viewer with the full items (potions, enchantments, etc.).
- The Statistics Book shows the total money earned and lost per slot. It is stored on the shelf, so it survives restarts.
Flexible Pricing System
- Global Prices: Set default prices for any item in
pricing.yml or with /shops itemprice, including potions, enchanted books, goat horns, player heads and more.
- Custom Price Stamps: Use
/shops price to stamp a one-off price onto a held item, then put it on a shelf.
- Per-Slot Control: Each slot can have its own buy price, sell price and stack amount (e.g. $10 for 64 dirt).
Lag-Friendly Text Displays
- Prices, stock and status are shown with Minecraft's Text Display Entities: no packet hacks, no legacy holograms. They only rebuild when something actually changes and re-sync to clients less often.
- Configurable Scaling: Size the header, amount and price displays independently (1–10).
- View Range: Separate render distances for shop headers and price tags.
- Two Price Display Modes:
TRIPLEPRICE (a price per slot) or SINGLEPRICE (one merged price).
- Item Language: Localize item names with any Minecraft locale (
en_us, de_de, fr_fr, …).
Web Map Markers
- Shops show up on BlueMap, Dynmap and squaremap with the owner or label and the items for sale. Works automatically when one of those mods is installed (
web_map in config.yml).
Bedrock Support (Geyser / Floodgate)
- Bedrock players can sneak + tap the upper half of a shelf to open the shop viewer, see the buy and sell price under each item, and use the paper in the Price GUI instead of right-click. Java players are not affected.
Translations
- Set
language in config.yml. Every language gets its own messages_<language>.yml with your edits kept, and the help pages are translated too.
Protection & Security
- Linked containers can only be opened or broken by their owner or an admin.
- Shop shelves and their linked containers are immune to explosions, the wither and fire, and hoppers, hopper minecarts and copper golems can't take items out of or put items into active shops (
container_protection).
- Trades never lose items or money: anything that doesn't fit is dropped, and failed trades are refunded.
- The front-face item slots can't be broken by accident: owners and admins break a shelf by hitting its top or bottom edge.
Shop Management
- Player Shop Limits: Cap player shelves per player with permissions (e.g.
shopshelves.playershelves.5) or grant unlimited.
- World Allowlist: Restrict player shops to specific worlds with
allowed_worlds or in game with /shops worlds. Admins can grant per-world or blanket bypass permissions.
- Admin Mode:
/shops admin lets operators bypass all protections and set up shops.
- Clickable Help:
/shops opens a help menu with clickable commands, without the "Confirm Command Execution" screen.
- Update Checker: Players with
shopshelves.update get a notice when a newer Fabric build is on Modrinth.
- Config Auto-Migration: New
config.yml and messages.yml keys are added automatically on updates, and your comments are kept.
Made to work with TradeShelves
Install TradeShelves next to ShopShelves and they detect each other on startup and work together:
- One shelf, two hands: Player shops made with the main hand become ShopShelves shops and player shops made with the off-hand become trade shelves (swap it with
TradeShelves_offhand). Admin shops keep using each mod's own admin mode.
- Money and trades on one chest: An owner can put a ShopShelves shop and a trade shelf on the same chest. Other players can't use a chest that is already linked to someone else's shop.
- One reload:
/shops reload or /trades reload reloads both mods, ShopShelves first.
- Shared permissions and limits: Optionally let TradeShelves use the ShopShelves permission nodes and player shop limit (see Compatible Settings below).
- ShopShelves always takes priority, and both mods leave each other's shelves alone.
⚙️ Setup & Usage
1. Admin Shop Setup
- Place a Shelf Block.
- Enter Admin Mode: run
/shops admin.
- Set Mode: while sneaking, right-click the middle of the shelf to cycle NONE → BUY → SELL → DUAL.
- Set Item & Price: hold an item (with a global price configured, or with a Price Stamp) and right-click a slot to fill it.
- Price GUI: sneak + right-click the top or bottom edge of the shelf.
2. Player Shop Setup
- Place a Chest, Barrel or Copper Chest.
- Link Shelf: while sneaking, place a Shelf Block against the container. The shelf is linked automatically. With TradeShelves installed, use your main hand (or the off-hand if the server swapped it).
- Set Price: shift + right-click your shelf to open the Price GUI.
- Stock Your Shop: add items to the linked container. The display updates automatically.
3. Customer Interactions
- Right-click slot: buy one stack.
- Left-click slot: sell one stack.
- Sneak + click (admin shops): buy or sell a full stack at once.
- Shift + click top edge: open the read-only shop viewer.
- Bedrock: sneak + tap the upper half of the shelf to open the shop viewer.
Commands
/shops, /shopshelves: Opens the help menu with clickable commands.
/shops help admin: Opens the admin help page.
/shops list (/shops sales): Shows the sales collected at your shops.
/shops outofstock (/shops stock): Shows your shops that ran out of stock.
/shops admin [player]: Toggles admin setup mode for yourself or another player.
/shops reload: Reloads config.yml, pricing.yml and messages.yml and refreshes displays. Also reloads TradeShelves when installed.
/shops update: Forces a full refresh of all shop text displays.
/shops worlds [add|remove] <world>: Views or changes the player shop world allowlist.
/shops mode [mode]: Views or sets the message delivery mode (CHAT | ACTIONBAR | BOTH) or price display mode (SINGLEPRICE | TRIPLEPRICE).
/shops itemprice [price] [buy|sell|both] [amount]: Views or sets the global price for the held item.
/shops price <price> [buy|sell|both] [amount]: Stamps a custom one-off price onto the held item. Only one stamped item is allowed in your inventory at a time.
Permissions
Click to view all permission nodes and their descriptions
shopshelves.command: Access to /shops, the help page, /shops list and /shops outofstock. (Default: all players)
shopshelves.admin: Usage of /shops admin. (OP Level 2)
shopshelves.reload: Usage of /shops reload. (OP Level 2)
shopshelves.update: Usage of /shops update and receiving the update notice on join. (OP Level 2)
shopshelves.mode: Usage of /shops mode. (OP Level 2)
shopshelves.itemprice: Usage of /shops itemprice to manage global pricing. (OP Level 2)
shopshelves.price: Usage of /shops price to create price stamps. (Default: all players)
shopshelves.worlds: Usage of /shops worlds to manage the world allowlist. (OP Level 2)
shopshelves.playershelf: Allows a player to create player shelves. (Default: all players)
shopshelves.playershelves.<number>: Sets the maximum number of player shelves (e.g. shopshelves.playershelves.10). (OP Level 2)
shopshelves.playershelves.unlimited: Grants unlimited player shelves. (OP Level 4)
shopshelves.playershelf.worlds: Bypasses the world allowlist for all worlds. (OP Level 4)
shopshelves.playershelf.<world>: Bypasses the world allowlist for a specific world. (OP Level 4)
shopshelves.setlabel: Allows setting a custom shop label via the Price GUI. (OP Level 2)
shopshelves.setlabel.color: Allows color/formatting codes in custom shop labels. (OP Level 4)
Works with LuckPerms through the Fabric Permissions API. Without a permissions mod, the OP levels above are used.
Compatible Settings
These settings in the ShopShelves config.yml only do something when TradeShelves is installed too. ShopShelves takes priority, so it owns them.
# ─── Compatible settings (only used when TradeShelves is installed) ───
# true: ShopShelves player shops use the main hand, TradeShelves player shops use the off-hand.
# false: the other way around.
TradeShelves_offhand: true
# true: TradeShelves uses the ShopShelves permission nodes (tradeshelves.X = shopshelves.X).
TradeShelves_permissions: false
# true: TradeShelves uses the default player shop limit from this config.
TradeShelves_ownlimit: false
Shared permissions: With TradeShelves_permissions: true, every tradeshelves.X node is checked as shopshelves.X (for example shopshelves.playershelf, shopshelves.playershelves.5), and tradeshelves.arrow becomes shopshelves.mode.
🛠️ Developer API: ShopshelvesApi
For mod developers, ShopShelves exposes shop shelf functions via me.andy.shopshelves.api.ShopshelvesApi.
ShopshelvesApi api = ShopshelvesApi.getInstance();
// Check if a block entity is an active shop of any kind
boolean isShop = api.isShopShelf(blockEntity);
// Shop mode: BUY, SELL, DUAL or PLAYERSHELF
Optional<ShopHelper.ShopMode> mode = api.getShopMode(blockEntity);
// Owner UUID of a player-owned shelf
Optional<UUID> owner = api.getShopOwner(blockEntity);
Events
Listen to me.andy.shopshelves.api.ShopShelvesEvents (Fabric API events). Return false to cancel; every event fires on the server thread before anything changes.
// A shop is about to be created
ShopShelvesEvents.SHOP_CREATE.register((player, world, pos, mode) -> true);
// A shop is about to be removed (broken or switched back to NONE)
ShopShelvesEvents.SHOP_REMOVE.register((player, world, pos, previousMode) -> true);
// A buy or sell is about to happen, before any money or item moves
ShopShelvesEvents.TRANSACTION.register((player, world, shelfPos, owner, item, amount, price, type) -> true);
Making your shelf mod compatible
ShopShelves and TradeShelves leave a shelf alone when another mod has claimed it. On Fabric every shelf mod mixes its own interface into ShelfBlockEntity, so add one of these methods to your mixin interface:
boolean isShelfClaimed(): return true while the shelf is yours. The simplest option.
getShopMode(): return an enum or String, any value except NONE.
public interface MyShelf {
// ShopShelves / TradeShelves ignore every shelf where this returns true
default boolean isShelfClaimed() {
return isMyShelfActive();
}
boolean isMyShelfActive();
}
Return false (or NONE) when your shelf turns back into a normal shelf, and our mods will treat it as a plain shelf again.
Requirements
- Minecraft: 26.3 (builds for older versions are in the Versions tab)
- Loader: Fabric Loader + Fabric API (server-side only, no client install needed)
- Required: EcoBal (economy)
- Optional: LuckPerms + Fabric Permissions API for permission nodes
- Optional: TradeShelves: item-for-item trades next to your shops, with the compatible settings above
- Optional: BlueMap, Dynmap or squaremap: shop markers on your web map
- Optional: Geyser + Floodgate: Bedrock player support
Modpack Policy
- You ARE PERMITTED to include ShopShelves in any modpack.
- Credit is appreciated but not strictly required.
- Please do not modify the mod's JAR file directly.
- The modpack itself, or access to this mod within the modpack, must not be sold.
评论 0
登录后参与评分
还没有评论,来抢沙发吧