Commands
Base command: /shop (ShopCommand, @CommandAlias("shop")). Two standalone commands, /sellall and /sellhand (alias /sell), round out the player-facing surface.
Command | Permission | Completion | Description |
|---|---|---|---|
|
|
| Open a shop's menu for an online player. |
|
| — | Reload shop, menu, and message configuration. |
|
| — | Sell every sellable item across all shops out of the player's inventory. Player-only. |
|
| — | Sell the item in the player's main hand. Player-only. |
ShopCommand carries a class-level @CommandPermission("shop.command"), so every /shop subcommand requires that node in addition to its own. ShopCommand has no @Default handler — only open and reload are registered as subcommands.
/shop open <player> <shop>
Permission: shop.command + shop.command.open. Completion: @players @shops. Works from console — the handler takes a CommandSender, and the target is resolved as an ACF OnlinePlayer (must currently be online).
Opens the shop menu for player via MenuService#openShopMenu, which calls MenuContainer#computeAndOpen(player, "shop", Map.of("shop", configuration)) against the shop menu blueprint. There is no requirement that the sender and the target be the same player — this is the command an operator or a menu button uses to put another player's client into a given shop's menu.
/shop reload
Permission: shop.command + shop.command.reload. Works from console.
Calls AstralShop#loadConfiguration(), which reloads, in order:
Shops —
PaperShopService#load()re-scans theshops/folder into freshShopConfigurationinstances.Menus —
MenuService#load().Messages —
messages.yml(theShopMessagesenum).
The sender gets a "Reloading shop configuration..." message, then either "Shop configuration reloaded successfully." or, if loadConfiguration() throws, "Failed to reload shop configuration." with the exception logged to console.
Shop argument
<shop> in /shop open is resolved through ShopContextResolver, an ACF ContextResolver<ShopConfiguration, ...>: it pops the next argument and looks it up with plugin.shops().findShopById(shopName), throwing InvalidCommandArgument ("Shop with ID '<shopName>' not found.") if no shop with that id is currently loaded. Tab completion (@shops, registered as ShopCompletionHandler) lists the ids of every loaded shop (plugin.shops().shops().keySet()). See Shop Configuration for how a shop's id is set and where shop files live.
/sellall
Permission: shop.sell.all. Player-only — the handler takes a Player, not a CommandSender.
The @Default subcommand calls PaperShopService#sellAll(player), which iterates every loaded shop and every sellable item in it, sells whatever quantity of that item the player currently holds (one silent sell per matching item — no per-item message), then, once every sale settles, reports a single combined total with SOLD_ALL_ITEMS (%amount%/%earnings%). If the player holds nothing sellable across any shop, sellAll returns false and the sender instead gets NOTHING_TO_SELL_IN_INVENTORY.
/sellhand
Alias: /sell. Permission: shop.sell.hand. Player-only.
The @Default subcommand reads the item in the player's main hand. If it is empty/air, or no loaded shop marks a matching item sellable (ShopService#canBeSold), the sender gets NOTHING_TO_SELL_IN_HAND. Otherwise it calls PaperShopService#sell(player, itemStack), which scans every shop's items for the first sellable one whose display stack isSimilar to the held item and sells the entire held amount through that shop/item pair, notifying the sender with ITEM_SOLD.
See Messages for the full default text of nothing-to-sell-in-inventory, nothing-to-sell-in-hand, item-sold, and sold-all-items.
Permission summary
Node | Grants |
|---|---|
| Base node for |
|
|
|
|
|
|
|
|