Item Exchange: Difference between revisions

From CivWiki
Jump to navigation Jump to search
Content added Content deleted
(rewrite intro, slight clean up (needs more work), move to separate page)
 
m (→‎External Links: added github)
 
(20 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Mechanics series}}
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.
'''ItemExchange''' is a [https://github.com/CivMC/ItemExchange community-made] plugin that facilitates asynchronous trade without sacrificing physicality or raidability.


== Creation ==
== Mechanics ==


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.
Chests contain "Exchange Rules" which are stone buttons with lore containing trade information.


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.
'''1) First way to create exchange rules:'''


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 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.


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 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.


== Creating an Exchange Rule ==
'''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.
There are three ways to create an Exchange Rule, each via the <code>/iecreate</code> command (<code>/iec):</code>


* <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.
'''2) Second way to create exchange rules:'''


* <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.
If you don't have access to the items you're buying/ selling there are other commands you can use.


* <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.
/iec input [item] [quantity]


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


* <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.
/iec output [item] [quantity]


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


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


=== Editing exchange rules ===


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


* <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.
/ies amount [number]


* <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.
For example: /ies amount 5. This will change the exchange to trade 5 of whatever item


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


* <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.
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 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>
'''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 ignoredisplayname</code> will cause the Exchange Rule to ignore display names.
== Buying ==


* <code>/ieset displayname [name]</code> will set the required display name. Not specifying a name will cause the Exchange Rule to ignore display names.
There can be multiple exchanges available from a single shop chest. Make sure to left click and be looking at the exchange you want (For example Exchange 1/2 or Exchange 2/2). Hold the input item in your hand and then right click the chest. The input will be removed from your hand and the output automatically added to your inventory.

* <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 ==


Ender chests search and return contents of shops chests that are within 4 blocks apart between ender chests and shops chests when clicked. Any blocks except iron fences and glasses in between both will block ender chests from search and connect to shops chests.
Enderchests search and return contents of nearby shopchests when clicked. [https://old.reddit.com/r/civclassics/comments/hh646y/introducing_shop_relays_using_ender_chests_to/ More information].

== External Links ==

* https://old.reddit.com/r/civclassics/comments/hh646y/introducing_shop_relays_using_ender_chests_to/ - an introduction to [[#Relays| relays]]
* https://github.com/DevotedMC/ItemExchange - ItemExchange on the DevotedMC Github Wiki

{{Template:Mechanics}}

Latest revision as of 14:02, 8 December 2023

ItemExchange is a community-made plugin that facilitates asynchronous trade without sacrificing physicality or raidability.

Mechanics

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.

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.

Shops can, by default, be made with chests, trapped chests, barrels, dispensers, and droppers. Find out what containers are supported using the /ieinfo shopblocks command.

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.

Creating an Exchange Rule

There are three ways to create an Exchange Rule, each via the /iecreate command (/iec):

  • /iecreate <input/output> while holding an item in your main hand will create a rule with its criteria as close to matching that item as possible.
  • /iecreate <input/output> <material> [amount] will create a barebones rule of just the material and the amount, which defaults to 1 if not specified. See Paper's Material list for reference.
  • /iecreate 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.

Modifying an Exchange Rule

Exchange Rules can be modified using the /ieset command (/ies) while holding the button:

  • /ieset amount <amount> will update the amount, which must be higher than zero.
  • /ieset switchio will flip the exchange rule from an input to an output, and vice versa.


Exchange Rules can also contain Modifiers, which are additional bits of criteria that can increase the specificity of an exchange.

  • /ieset durability [damage] 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.
  • /ieset repair [level] 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.
  • /ieset ignoreenchants will cause the Exchange Rule to ignore enchantments altogether.
  • /ieset allowenchants will cause the Exchange Rule to ignore unspecified enchantments./ieset denyenchants will do the opposite, ensuring that only the specified enchants are allowed.
  • /ieset enchant <+/?/-><enchantment>[level] will [re]set enchantment requirements for the Exchange Rule. See Paper's Enchantment list for reference. You can add a required enchantment like so /ieset enchant +DURABILITY3 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 /ieset enchant -DURABILITY meaning that the item must NOT be enchanted with DURABILITY to meet the requirement. You can then reset an enchantment rule via /ieset enchant ?DURABILITY
  • /ieset ignoredisplayname will cause the Exchange Rule to ignore display names.
  • /ieset displayname [name] will set the required display name. Not specifying a name will cause the Exchange Rule to ignore display names.
  • /ieset ignorelore will cause the Exchange Rule to ignore item lore.
  • /ieset lore [lore] 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 delimiting each line with a semicolon like so /ieset lore First Line;Second Line
  • /ieset group [group] will set the required 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

Ender chests search and return contents of shops chests that are within 4 blocks apart between ender chests and shops chests when clicked. Any blocks except iron fences and glasses in between both will block ender chests from search and connect to shops chests.

External Links