Item Exchange
Item Exchange turns a chest into a shop. You put exchange rules in the chest that say what a customer pays and what they get, stock it, and anyone can trade by punching the chest. You don't have to be online and the customer never opens the chest.
Building a shop
A shop is a supported container with at least one input rule inside it. Rules are items. On this server a rule is a piece of paper that carries the exchange data, named "Input: 10 Iron Ingot" or "Output: 1 Diamond" with the details in its lore.
The quickest way to make a pair of rules:
- Place the container.
- Put the payment in it and, in a later slot, the goods. For 10 iron ingots per diamond that is 10 Iron Ingot followed by 1 Diamond. The chest may hold only these two kinds of item, and the amounts in the chest become the amounts of the trade.
- Look at the chest from within 6 blocks and run
/iecreate. - An input rule and an output rule appear in the chest. Fill the rest of it with stock.
The item in the earlier slot becomes the input, which is what the customer pays. If the chest holds only one kind of item you get a single input rule.
You can also make rules one at a time. Hold the item and run /iecreate input or /iecreate output to copy it, stack size included, or name a material with /iecreate input <material> [amount]. These rules land in your inventory and you place them in the chest yourself.
Containers that work
Shops can be chests, trapped chests, barrels, dispensers, droppers and copper chests. Every copper chest variant works except the waxed weathered one. A double chest is one shop. /ieinfo shopblocks prints the list in game.
How rules pair up
The shop reads the rules in slot order, left to right and top to bottom. An input rule followed by an output rule is one exchange. Put several pairs one after another and the shop offers several exchanges.
An input rule with no output rule after it is a donation box. It takes the payment and gives nothing back. An output rule with no input rule before it is ignored.
Other items between the rules don't matter. The stock and the payments can sit anywhere in the chest.
Bulk rules
A bulk rule packs several rules into one item so they take up one slot. Put two rule items in a crafting grid and the result is a "Bulk Rule Block" holding both, in grid order, so place the input before the output. A bulk rule can go back in the grid with another rule or another bulk rule to add more.
In a shop a bulk rule counts as the rules inside it, in order. To take one apart, drop it. It splits into its single rules as it leaves your hand.
Using a shop
Punch the shop with a left click. The first punch shows the first exchange in chat: its number, such as "(1/3) exchanges present.", the input, the output, and how many exchanges are in stock.
Punch again with an empty hand, or with anything that is not the payment, to step to the next exchange. Sneak while punching to step backwards.
To buy, hold the payment and punch while the exchange you want is showing. The full amount is taken from anywhere in your inventory, and the goods go straight into your inventory. Chat confirms the exchange.
If more than 10 seconds have passed since your last punch, the next punch only browses, so a stale selection can't buy something by accident. Punching a wall sign attached to the shop counts as punching the shop.
A trade fails with a message if you don't have the full payment, if the shop is out of stock, or if there is no room, either in your inventory for the goods or in the shop for your payment. A shop that is full of payments stops selling, so empty it now and then.
What a rule matches
How strict a rule is depends on how you made it.
A rule made from an item, by /iecreate on a chest or with the item in your hand, copies that item closely. It matches only items with the same custom name or no name, the same lore, exactly the same enchantments, the same damage, and for tools, weapons and armour the same anvil repair level. Potions have to be the same potion, written books the same book, and enchanted books must hold the same enchantments.
A rule made from a material name matches every item of that material and checks nothing else.
That difference matters here because many items on this server are vanilla items with a custom name or lore. A Steel Ingot from Factory Mod is an iron ingot with a name, and a compacted item is the plain item with the lore "Compacted Item". A rule for IRON_INGOT made by material name accepts Steel Ingots and compacted iron as payment, and as an output rule it will hand them out if they are in the chest. Make the rule from the real item when it has to be exact.
A rule made from a used pickaxe only matches pickaxes with that exact damage. Loosen it with the commands below.
Changing a rule
Hold the rule and run /ieset, or /ies for short, with one of these. A stack of identical rules is changed together.
| Command | Effect |
|---|---|
/ieset material <material> |
Changes the item type. |
/ieset amount <number> |
Changes the amount. It must be 1 or more. |
/ieset switchio |
Turns an input rule into an output rule or back. |
/ieset durability |
Stops checking damage. |
/ieset durability any |
Accepts any amount of damage. |
/ieset durability used |
Accepts only damaged items. |
/ieset durability <number> |
Accepts only items with exactly that many points of damage. 0 means undamaged. |
/ieset repair |
Stops checking the anvil repair level. |
/ieset repair new |
Accepts only items that were never repaired. |
/ieset repair <level> |
Accepts items at that repair level or lower. The lowest level you can enter is 2. |
/ieset repair @<level> |
Accepts items at exactly that repair level. |
/ieset enchant +<enchantment>[level] |
Requires an enchantment, for example /ieset enchant +sharpness5. Leave the level off to accept any level.
|
/ieset enchant -<enchantment> |
Refuses items with that enchantment. |
/ieset enchant ?<enchantment> |
Removes what the rule says about that enchantment. |
/ieset allowenchants |
Accepts enchantments the rule does not list. |
/ieset denyenchants |
Refuses enchantments the rule does not list. A rule copied from an item starts this way. |
/ieset ignoreenchants |
Stops checking enchantments. |
/ieset displayname <name> |
Requires that custom name. Without a name, stops checking names. |
/ieset ignoredisplayname |
Switches name checking off, or back on. |
/ieset lore <line;line> |
Requires that lore. Separate lines with a semicolon. Without text, requires an item with no lore. |
/ieset ignorelore |
Stops checking lore. |
/ieset group <group> |
On an input rule, limits the exchange to that Name Layer group. Without a group name, removes the limit. |
Enchantments are written with their Minecraft names, such as sharpness, unbreaking or fire_aspect.
Group shops
An input rule with a group on it shows "Group:" and the group's name. Anyone can still browse the exchange, but only players who hold the PURCHASE_PERMISSION permission on that group can buy. Members, mods, admins and the owner have it by default.
Reinforcing and securing a shop
Reinforce the shop with Citadel like any other chest. Customers trade by punching, which needs no access, so the chest can stay locked to everyone but your group.
Running /iecreate on a reinforced container only works if you have chest access on its group.
Hoppers can't move rule items and can't pick them up from the ground, so the rules can't be drained out of a shop from below.
A jukebox snitch that covers the shop logs trades there as "ItemExchange purchase" entries, next to everything else it records (see Juke Alert). A trade at a shop inside a Commerce node counts towards that node's Aether payout (see Node Specialisations).
Shop relays
An ender chest can stand in for a shop that is out of reach. Punch the ender chest and it looks in all six directions, up to 4 blocks away, for a shop block and shows that shop's exchanges. You trade through the ender chest exactly as you would at the shop.
The search passes through air, water, lava, iron bars, glass, stained and tinted glass and glass panes. Any other block stops it. A relay that finds shops in several directions offers all of them together. Relays don't chain, so an ender chest never looks through another ender chest.
Trade buttons
A shop can press a button when a trade goes through, which is useful for doors and counters. Put a solid block directly behind the shop, on the side opposite its front, and mount a button on that block. Each successful trade presses the button for a second and a half.
This works for chests, trapped chests, barrels, the copper chests that can be shops, and for an ender chest used as a relay. It does not work for dispensers and droppers.
Commands
| Command | Alias | What it does |
|---|---|---|
/iecreate |
/iec |
Looking at a shop block that holds one or two kinds of item, puts matching input and output rules in it. |
/iecreate input/iecreate output |
/iec in, /iec out |
Gives you a rule copied from the item in your hand. |
/iecreate input <material> [amount]/iecreate output <material> [amount] |
Gives you a rule for that material. The amount is 1 if you leave it off. | |
/ieset <field> [value] |
/ies |
Changes the rule in your hand. See the table above. |
/ieinfo shopblocks |
/iei shop |
Lists the blocks that can be shops. |
/ieinfo successbutton |
/iei button |
Lists the shop blocks that can press a trade button. |
/ieinfo ruleitem |
/iei rule |
Says which item rules are made of. |
/iedebug |
/ied |
Prints the raw data of the rule in your hand. |