Trade
Trading face to face: requests, the window, money, both accepts and the countdown, what calls a trade off, and the window file.
"You drop yours first" is the most reported scam on a survival server. A trade fixes it with a window in which nothing changes hands until both players have accepted exactly what is on screen and a short countdown has run out.
Module id trade, file modules/trade/config.yml, command /trade.
Asking
| How | What it does |
|---|---|
/trade <player> | Sends a request. |
| Sneak + right-click a player | The same, when request-on-shift-click is on. It runs /trade <player> as the player typed it, so plugins that block commands in combat or jail stop it too. |
/trade accept [player] | Accepts that player's request, or the newest one. |
/trade deny | Denies the newest request. Needs no permission, so a player whose rank lost trading can still say no. |
Two players asking each other are both accepting. A request is forgotten after request-expire-seconds.
Before a request goes out: not yourself, not already trading, neither player in combat, not in creative
unless allow-creative, the same world when same-world is on, within max-distance blocks, and the other
player accepts trade requests — Market → Trade requests in /settings, on by default. A request to
a player in combat says how long their fight has left.
Combat is whatever the server's combat plugin says, read through ExyliaLib; with none installed nobody is ever in combat.
The window
Your grid is on the left, the other player's on the right. Put items in your grid; the other side mirrors theirs live. Shift-clicking from your inventory fills your grid; anything that could move items the wrong way is blocked.
- Money: with
allow-moneyon, the money button opens a page of currencies. Left-click one to offer an amount, up to your balance; right-click clears it. Opening the page withdraws both accepts. - Accept: your status button. Any change to either grid or either offer withdraws both accepts.
- Cancel: calls the trade off.
When both have accepted, a countdown of confirm-delay-seconds (3 by default) runs, in the window and as
the feedback.trade-countdown says — BOSS_BAR, TITLE or NONE. Anything changed during it starts over.
At zero both grids are compared again, money moves both ways — each player pays on their own thread, so
item and experience currencies are taken from what they carry — then the items, each through
delivery: what does not fit waits in /collect.
What calls a trade off
Closing the window, the cancel button, dying, leaving the server, switching to creative (unless allowed),
another world, walking beyond max-distance (checked every second), either player entering combat, money
no longer there at the swap, a restart. Each grid goes back to its owner, through /collect if they are not
there. Taking damage outside combat does not cancel a trade.
Items in an open trade are held in memory. A server crash, as opposed to a restart, loses them.
Currencies on the money page
currencies lists the currency ids that may be offered. Empty, it is every currency the server has, the
default first. The page holds 28. Item and experience currencies are offered as well when the economy
lists them, despite the key's comment saying they never qualify, and are paid from each player's
inventory or experience at the swap.
The window file
lang/<code>/modules/trade/window.yml holds the title (%partner%), the money page's title and empty text,
and every button: separator, frame, own-waiting, own-ready, partner-waiting, partner-ready,
info, countdown, money-own, money-partner, money-entry, money-back, cancel. A key missing from
it is drawn as a barrier. The slots are fixed.
Settings
Under settings: in modules/trade/config.yml, editable in game from /marketadmin.
| Key | Default | What it does |
|---|---|---|
request-expire-seconds | 30 | Seconds before a request is forgotten. 0 or less: never. |
request-on-shift-click | true | Sneak + right-click a player asks them to trade. |
max-distance | 10.0 | Blocks apart two players may be. -1 (or any value up to 0) is anywhere. |
same-world | true | Both players in the same world. |
confirm-delay-seconds | 3 | Seconds between both accepts and the swap. |
allow-money | true | Money can be offered alongside items. |
currencies | [] | Currencies that may be offered. Empty is every one. |
allow-creative | false | Whether a player in creative may trade. |
blocked-materials | [] | Materials that may not be put in a trade, inside boxes and bundles too. |
max-item-kilobytes | 64 | Heaviest item that may be offered. 0 for no cap. |
And under sounds: — request, opened, accepted, countdown, completed, cancelled.
A finished trade is written to the market log with both sides' items and money, counts trade.completed,
and fires MarketDealEvent once per side. See Integrations.
Something missing on this page? Tell us on Discord