Skip to content
Rosti Studios

RS-Economy documentation · v2.0.0

Sign shops

Turn a sign on a chest into a shop that buys, sells and keeps its own stock line current.

A sign placed on a chest, barrel or any other container becomes a shop. Players open them themselves; you do not have to be involved.

#Create a shop

Place a sign on the container and write:

Line Content Example
1 [Shop], optionally followed by an item [Shop] diamond
2 how many items change hands per trade 4
3 buy price, then sell price 100 50
4 left empty. The mod fills in the stock

#Line 1: the item

  • [Shop] diamond fixes the item. You can write the registry id (diamond, minecraft:diamond, or an id from another mod) or the item's display name (Diamond Sword). The brackets and capital letters are optional.
  • [Shop] on its own makes a container shop: it trades whatever lies in the container. Restock it with something else and the sign follows.

#Line 2: the amount

A whole number, at most 2,304 items per trade.

#Line 3: the prices

Two numbers: what a customer pays to buy and what the shop pays when a customer sells. Put a dash to close one direction:

Written Meaning
100 50 customers buy for 100, sell for 50
100 - the shop only sells
- 50 the shop only buys
(empty) the shop is closed

Prices accept the short forms: 1.5k, 2M.

Sell price above buy price is refused by default. Such a shop would pay out more than it takes in and drain its owner. If you really want that, set shop_allow_sell_above_buy = true.

#What the mod does when you confirm

  • Reads the sign, finds the item and registers the shop under your name.
  • Waxes the sign, so it cannot be edited into a different deal.
  • Stores the real owner, prices and amount outside the sign. Repainting the text changes nothing.
  • Colours the lines and writes the stock: Stock: 128, or Sold out.
  • Protects the container. Only the owner and admins can open or break the chest, and only they can break the sign (shop_protect_container).

#Using a shop

Action Result
Right-click buy
Sneak + right-click sell
Owner: right-click shows your stock
Owner: sneak + right-click opens the shop in the sign editor

A purchase moves money from the buyer to the owner and items from the chest to the buyer, in one step. If the buyer's inventory is full the items drop at their feet. If the chest is out of stock, or the owner cannot afford to buy, the trade is refused with a message. A completed trade is confirmed over the hotbar (shop_trade_feedback). Failures always go to chat.

#Editing or closing a shop

Sneak + right-click your own sign. The sign unwaxes and opens for editing; change the lines and confirm. Leave the price line empty to close the shop. While you edit, nobody else can trade with it.

Breaking the sign or the chest removes the shop. If the container is destroyed some other way, the shop is dropped the next time someone touches the sign.

#Server shops (admin)

Look at any sign and run:

Command
/rs:economy shop_create <item> <count> <buy_price> [sell_price]

An admin shop has unlimited stock and needs no container. It mints the items and swallows the money, so it is the way money enters and leaves the economy through trade. Only admins can take it down. Leave out the sell price and it only sells.

#Limits and switches

Setting Default What it does
shop_status true turn all sign shops on or off
shop_max_per_player 0 cap on shops per player, 0 is no limit
shop_protect_container true lock the chest to its owner
shop_allow_sell_above_buy false allow shops that pay more than they charge
shop_trade_feedback true confirm trades over the hotbar

Turn shops off live with /rs:economy shop disable.

#Good to know

  • A shop whose item comes from a mod you later remove is left alone, not deleted. It works again when the mod returns.
  • Shops share the player's balance with everything else, so a bounty, a trade and a purchase all draw from the same wallet.

Something missing or wrong? Tell us on Discord. This documentation describes v2.0.0.