Item Exchange: Difference between revisions

From CivWiki
Jump to navigation Jump to search
Content added Content deleted
("civ-plugin" -> "plugin". I brought this up in the civwiki discord and there weren't enough opinions offered to come to a consensus on if "civ-plugin" should be used, so I'm reverting this to keep the plugin ledes consistent until/if/when a consensus is ever reached.)
Tag: Manual revert
(Reverting)
Tag: Manual revert
Line 1: Line 1:
'''ItemExchange''' ([https://github.com/CivMC/ItemExchange source]) is a plugin that facilitates asynchronous trade without sacrificing physicality or raidability.
An '''Item Exchange''' or '''Shop Chest''' is a chest which allows players to exchange items in their inventory for items in the chest's inventory. It is managed by the '''ItemExchange''' plugin ([https://github.com/CivMC/ItemExchange source]). These exchanges are governed by exchange rules placed inside the chest. Item exchanges allow for asynchronous trading.


== Mechanics ==
== Creation ==


Chests contain "Exchange Rules" which are stone buttons with lore containing trade information.
Shops chests are created when they contain Exchange Rules: encoded buttons which specify the rules of an exchange. Exchanges are made of pairs of inputs and outputs (though an output rule is not strictly necessary and a "donation" item exchange uses only an input rule). Bulk exchange rules are a single encoded button which contains within it one or more pairs of Exchange Rules.


'''1) First way to create exchange rules:'''
Players can view and cycle through a shop's available exchanges by punching a shop chest, preferably with an empty hand. If the player then punches the chest again on a given exchange with a matching input, and the shop chest is stocked, then the exchange is transacted.


* Hold the item you want, in the quantity you would like, (For example, 5 diamonds) and type /iec input. An exchange rule (lored stone button) will be created in your inventory.
Shops can, by default, be made with chests, trapped chests, barrels, dispensers, and droppers. Find out what containers are supported using the <code>/ieinfo shopblocks</code> command.
* Hold the item you are selling, in the quantity you are selling for, (For example, one cow egg) and type /iec output. An exchange rule (lored stone button) will be created in your inventory
* Place the two buttons in a chest (make sure to reinforce it!). If you left click the chest it will now tell you the exchanges available.


'''Note:''' You can place multiple exchanges in a chest. For example, you can have one input rule of 5 diamonds and output rule of 1 cow egg. And also have one input rule for 4 diamonds and one output rule for 1 pig egg in the same chest. Left clicking the chest multiple times will allow you to move through all the available exchanges.
ItemExchange differs from other market and trade plugins in that it functions on a series of rules and criteria, rather than selling specific items. An Exchange Rule that ONLY specifies that the output is a Diamond Pickaxe will be able to output ANY Diamond Pickaxe, enchanted or not, used or not, repaired or not, named or not, etc.


'''Note:''' You can have multiple inputs for one output, or one input for multiple outputs. For example, one input rule of 5 diamonds and output rule of 1 cow egg, and a second output rule of 1 pig egg. Second example, one input rule of 5 diamonds, and a second input rule for 9 iron blocks and one output rule for 1 cow egg.
== Creating an Exchange Rule ==
There are three ways to create an Exchange Rule, each via the <code>/iecreate</code> command (<code>/iec):</code>


'''2) Second way to create exchange rules:'''
* <code>/iecreate <input/output></code> while holding an item in your main hand will create a rule with its criteria as close to matching that item as possible.


If you don't have access to the items you're buying/ selling there are other commands you can use.
* <code>/iecreate <nowiki><input/output></nowiki> <material> [amount]</code> will create a barebones rule of just the material and the amount, which defaults to 1 if not specified. See [https://jd.papermc.io/paper/1.18/org/bukkit/Material.html Paper's Material list] for reference.


/iec input [item] [quantity]
* <code>/iecreate</code> while looking at a chest (or other supported container) containing one or two stacks will add a corresponding input and output rule for those items. If the container is reinforced, you must have the required permissions for this command to function.


For example: /iec input diamond 5
== Modifying an Exchange Rule ==
Exchange Rules can be modified using the <code>/ieset</code> command (<code>/ies</code>) while holding the button:


/iec output [item] [quantity]
* <code>/ieset material <material></code> will update the material. See [https://jd.papermc.io/paper/1.18/org/bukkit/Material.html Paper's Material list] for reference.


For example: /iec output sapling 10
* <code>/ieset amount <amount></code> will update the amount, which must be higher than zero.


'''Note:''' The name of the item has to be the Minecraft data name. For example, dark_oak_sapling.
* <code>/ieset switchio</code> will flip the exchange rule from an input to an output, and vice versa.


=== Editing exchange rules ===


While holding an exchange, use the following command to change the quantity it trades:
Exchange Rules can also contain Modifiers, which are additional bits of criteria that can increase the specificity of an exchange.


/ies amount [number]
* <code>/ieset durability [damage]</code> will update how damaged the item should be. Not specifying the damage (or inputting "ANY") will cause the Exchange Rule to ignore durability altogether; inputting "USED" will cause the Exchange Rule to only accept damaged items.


For example: /ies amount 5. This will change the exchange to trade 5 of whatever item
* <code>/ieset repair [level]</code> will update the repair level of the item. This is useful if you wish to assure your customers that you're not selling them 33-level repair tools. Not specifying the repair level will cause the Exchange Rule to ignore repair levels altogether. If you specify a level with a proceeding "@" (eg: "@9") then the Exchange Rule will only accept items with a repair level of exactly 9; otherwise just specifying "9" will cause the Exchange Rule to accept items with a repair level 9 or lower.


== Browsing ==
* <code>/ieset ignoreenchants</code> will cause the Exchange Rule to ignore enchantments altogether.


It is customary to put a sign on the chest with the exchanges. However, if you left click the chest there will be text that says what the input and output for the chest are.
* <code>/ieset allowenchants</code> will cause the Exchange Rule to ignore unspecified enchantments.<code>/ieset denyenchants</code> will do the opposite, ensuring that only the specified enchants are allowed.


'''Note:''' Always check that there is an output! You don't want to put in diamonds only to realize you gave a free donation because they forgot to add an output.
* <code>/ieset enchant <+/?/-><enchantment>[level]</code> will [re]set enchantment requirements for the Exchange Rule. See [https://jd.papermc.io/paper/1.18/org/bukkit/enchantments/Enchantment.html Paper's Enchantment list] for reference. You can add a required enchantment like so <code>/ieset enchant +DURABILITY3</code> where the level is optional: not including the level will mean any level is adequate to meet the requirement. You can also add an excluded enchantment like so <code>/ieset enchant -DURABILITY</code> meaning that the item must NOT be enchanted with DURABILITY to meet the requirement. You can then reset an enchantment rule via <code>/ieset enchant ?DURABILITY</code>


== Buying ==
* <code>/ieset ignoredisplayname</code> will cause the Exchange Rule to ignore display names.


Cycle to the exchange you want by left clicking the chest with an empty hand, then hold the input item in your hand and then left click the chest. The input will be removed from your hand and the output automatically added to your inventory.
* <code>/ieset displayname [name]</code> will set the required display name. Not specifying a name will cause the Exchange Rule to ignore display names.

* <code>/ieset ignorelore</code> will cause the Exchange Rule to ignore item lore.

* <code>/ieset lore [lore]</code> will set the required item lore. Not specifying any lore will cause the Exchange Rule to ignore item lore. You can set multiple lines by [https://en.wikipedia.org/wiki/Delimiter delimiting] each line with a semicolon like so <code>/ieset lore First Line;Second Line</code>

* <code>/ieset group [group]</code> will set the required [[NameLayer|NameLayer group]] the player must have the necessary permissions on to use the exchange. Not specifying the group will cause the Exchange Rule to ignore group requirements. Group requirements only function on input rules.


== Relays ==
== Relays ==

Revision as of 23:10, 25 August 2022

An Item Exchange or Shop Chest is a chest which allows players to exchange items in their inventory for items in the chest's inventory. It is managed by the ItemExchange plugin (source). These exchanges are governed by exchange rules placed inside the chest. Item exchanges allow for asynchronous trading.

Creation

Chests contain "Exchange Rules" which are stone buttons with lore containing trade information.

1) First way to create exchange rules:

  • Hold the item you want, in the quantity you would like, (For example, 5 diamonds) and type /iec input. An exchange rule (lored stone button) will be created in your inventory.
  • Hold the item you are selling, in the quantity you are selling for, (For example, one cow egg) and type /iec output. An exchange rule (lored stone button) will be created in your inventory
  • Place the two buttons in a chest (make sure to reinforce it!). If you left click the chest it will now tell you the exchanges available.

Note: You can place multiple exchanges in a chest. For example, you can have one input rule of 5 diamonds and output rule of 1 cow egg. And also have one input rule for 4 diamonds and one output rule for 1 pig egg in the same chest. Left clicking the chest multiple times will allow you to move through all the available exchanges.

Note: You can have multiple inputs for one output, or one input for multiple outputs. For example, one input rule of 5 diamonds and output rule of 1 cow egg, and a second output rule of 1 pig egg. Second example, one input rule of 5 diamonds, and a second input rule for 9 iron blocks and one output rule for 1 cow egg.

2) Second way to create exchange rules:

If you don't have access to the items you're buying/ selling there are other commands you can use.

/iec input [item] [quantity]

For example: /iec input diamond 5

/iec output [item] [quantity]

For example: /iec output sapling 10

Note: The name of the item has to be the Minecraft data name. For example, dark_oak_sapling.

Editing exchange rules

While holding an exchange, use the following command to change the quantity it trades:

/ies amount [number]

For example: /ies amount 5. This will change the exchange to trade 5 of whatever item

Browsing

It is customary to put a sign on the chest with the exchanges. However, if you left click the chest there will be text that says what the input and output for the chest are.

Note: Always check that there is an output! You don't want to put in diamonds only to realize you gave a free donation because they forgot to add an output.

Buying

Cycle to the exchange you want by left clicking the chest with an empty hand, then hold the input item in your hand and then left click the chest. The input will be removed from your hand and the output automatically added to your inventory.

Relays

Enderchests search and return contents of nearby shopchests when clicked. More information.