Skip to main content

Shop

Module shop, needs the economy module. Settings files: shop.toml, worth.json, shop.json.

Commands​

CommandWhat it doesPermissionDefault
/sell hand|all|<item> [amount]Sell the held item, everything with a price, or one item (all of it without an amount)brita.shop.selleveryone
/buy <item> [amount]Buy an item (1 without an amount)brita.shop.buyeveryone
/worth [hand|<item>] [amount]Show what an item sells for and costsbrita.shop.wortheveryone
/shopOpen the shop menu; buying and selling in it need brita.shop.buy and .sellbrita.shop.menueveryone
Turn a [Buy] or [Sell] sign into a shop signbrita.shop.signsoperators

shop.toml has enabled (the whole shop), sell, buy, menu, signs and clickSound, all true. sell and buy switch selling and buying off everywhere: commands, menu and signs.

Prices: worth.json​

Run /brita reload after changing it. The mod writes an example with common items.

{"currency": "",
"items": {
"minecraft:diamond": {"sell": 50, "buy": 400},
"minecraft:rotten_flesh": 0.1,
"create:brass_ingot": {"buy": 12.5}
}}
  • currency is a currency id from economy.json; empty means the main one.
  • Per item id: sell is what a player gets for one piece, buy what one piece costs. A plain number is a sell price only. An item without a price (or with 0) cannot be sold or bought that way.
  • Players type items without minecraft: (/buy diamond 5); items from other mods with their full id.
  • Only unchanged items are sold: damaged, enchanted, named or filled ones (such as a full shulker box) stay with the player. /sell <item> takes from the inventory before the hotbar.
  • /buy refuses what does not fit into the inventory. Money moves first, items only once it has.
  • Keep buy prices above sell prices, otherwise players make money by buying and selling again. The server log warns about such items, about unknown items and about broken prices, which are left out.

Shop menu​

/shop opens the categories; a category opens its items, a page at a time. On an item:

ClickDoes
Left clickBuy one
Shift + left clickBuy a full stack (64, or 16 for items such as ender pearls)
Right clickSell one
Shift + right clickSell all of it

The layout is in shop.json; run /brita reload after changing it. Anything left out keeps its default.

{"title": "shop.menu.title", "rows": 3,
"frame": "minecraft:black_stained_glass_pane", "corners": "minecraft:orange_stained_glass_pane",
"balance": {"slot": 13, "item": "minecraft:gold_ingot"}, "close": {"slot": 22, "item": "minecraft:barrier"},
"categories": [
{"slot": 11, "item": "minecraft:diamond", "name": "Ores", "lore": ["Shiny things"], "items": ["coal", "diamond"]},
{"slot": 16, "item": "minecraft:chest", "name": "shop.category.other"}
],
"page": {"rows": 6, "slots": [10, 11, 12, 13, 14, 15, 16],
"balance": {"slot": 45, "item": "minecraft:gold_ingot"}, "previous": {"slot": 48, "item": "minecraft:arrow"},
"back": {"slot": 49, "item": "minecraft:oak_door"}, "next": {"slot": 50, "item": "minecraft:arrow"},
"close": {"slot": 53, "item": "minecraft:barrier"}}}
  • Slot 0 is top left; each row adds 9. Slot -1 hides a button.
  • title, name and lore are a key from the language files or your own text with colours.
  • frame fills every free slot, corners the four corners; "" leaves them empty.
  • A category shows the items of its items list that have a price, in the list's order. A category without items shows every priced item that no other category lists, so new prices appear there by themselves.
  • page.slots are filled with the items; previous and next only show when there is a page to turn to.

Shop signs​

  1. Place a sign and write [Buy] or [Sell] on line 1, the amount on line 2 (empty for 1) and the item on line 3 (diamond, or create:brass_ingot for other mods). Leave line 4 empty.
  2. Right-click it. With brita.shop.signs the sign becomes a shop sign: the mod writes the label, amount, item name and price, and waxes the sign so nobody can edit it.
  3. Players right-click the sign to buy or sell that amount.
  • Prices always come from worth.json. When a price has changed, the first click updates the sign and asks the player to click again, so nobody pays a price they did not see.
  • Labels and the line layout are in the language files (shop.sign.buy, shop.sign.sell, shop.sign.amount.line, shop.sign.price). Players always type [Buy] or [Sell].
  • Shop signs are not protected against breaking yet; use spawn protection or a claim mod.