DriftAuction
A player auction house that cannot be duped.
A player auction house for Paper 26.3: buy-it-now listings and bidding, sorting, categories, search, a collection box, sales tax and fees, and one auction house shared across a network. Built so items and money can't be duplicated. Part of DriftSuite.
Features
- Selling:
/ah sell <price>lists the stack in your hand./ah sell <price> bidstarts an auction instead.- Prices can be written like
1.5kor2m.
- Browsing:
/ahshows every listing with its price, bids and time left.- Sort by newest, cheapest, most expensive or ending soonest.
- Pick a category: blocks, tools, combat, food, potions, enchanted books or everything else.
- Search with
/ah search.
- Buying: click a listing, confirm in a pop-up showing the item, and it's yours.
- Bidding:
- Bids are held when they're placed, and the bid you beat is given back.
- Each bid has to beat the last by a minimum.
- A bid near the end pushes the end back, so nobody can snipe it at the last second.
- Looking inside shulker boxes: right-click one on sale to see its contents.
- Collection box: things you bought or won, and your own items coming back, wait in
/ah collectionuntil you have room. - Paying sellers: sellers are paid even when they're offline, and told what sold while they were away.
- Your listings:
/ah listings; click one to take it off sale (before anyone bids). - History:
/ah historyshows your last 10 sales and purchases. - Rules:
- Sales tax, a listing fee, a listing limit per rank and a cooldown.
- Minimum and maximum prices.
- Blocked items, checked inside shulker boxes and bundles too.
- No selling from creative.
- Staff: take any listing off sale and look at anyone's listings.
- Money: the Vault economy or any DriftEconomy currency.
- Networks: one auction house across servers with MySQL.
- Extras: PlaceholderAPI placeholders. Folia supported.
Requirements
- Paper (or a fork) 26.3, Java 25
- Vault with an economy plugin, or DriftEconomy (the auction house trades in one of its currencies)
- Optional: PlaceholderAPI
Installation
- Put
DriftAuction-<version>.jarinplugins/and start the server. It works without any changes and keeps its database inplugins/DriftAuction/data/(see Folder layout). - It needs a currency: Vault with an economy plugin (with DriftEconomy, set
features.vault: truein its config), or a DriftEconomy currency named undereconomy.currencyinconfig.yml. - For a network, set
storage.type: MYSQLon every server to share one auction house.
Commands
| Command | What it does | Permission |
|---|---|---|
/ah | Open the auction house | driftauction.use |
/ah sell <price> [bid] | Sell what's in your hand, or auction it starting at that price | driftauction.sell |
/ah search <text> | Find something | driftauction.use |
/ah listings | Your listings | driftauction.use |
/ah collection | Items waiting for you | driftauction.use |
/ah history | Your last sales and purchases | driftauction.use |
/ah buy <id> | Buy a listing by its number | driftauction.use |
/ah bid <id> <amount> | Bid an amount of your choice | driftauction.use |
/ah admin remove <id> | Staff: take a listing off sale | driftauction.admin.remove |
/ah admin listings <player> | Staff: anyone's listings | driftauction.admin.view |
/driftauction <reload|version|help> (/dauction) | Admin commands (help lists them, click a line to fill it in) | driftauction.admin |
/ah is also /auction, /auctions and /auctionhouse.
Permissions
| Permission | Default | What it allows |
|---|---|---|
driftauction.use | everyone | Browse, buy and bid. |
driftauction.sell | everyone | List items. |
driftauction.listings.<n> | nobody | Have up to n listings up at once (more than listing-limit). |
driftauction.admin.remove | op | Take any listing off sale. |
driftauction.admin.view | op | Look at anyone's listings. |
driftauction.admin | op | /driftauction reload and version. |
driftauction.bypass.fee | op | List without the listing fee. |
driftauction.bypass.cooldown | op | List without waiting for the cooldown. |
driftauction.bypass.creative | nobody | List items from creative and spectator. |
How selling and buying work
- Listing: the item leaves your hand when you list it.
- When it sells:
- Buy-it-now: the buyer pays the price.
- Auction: the highest bid wins when time runs out.
- The item goes to the buyer's collection box and moves into their inventory when there's room.
- The money goes to the seller, minus
sales-tax-percent, even if they're offline.
- When it doesn't sell: after
listing-hours(orbid-hoursfor auctions), it goes back to the seller's collection box. - Taking a listing off sale: it goes back to the seller's collection box. Sellers can only do this before anyone has bid.
Turning features on and off
| Switch | Default | What it covers |
|---|---|---|
bidding | true | Auctions (/ah sell <price> bid and bidding). |
broadcasts | true | Announcing new listings (when broadcast-new-listings is on). |
placeholders | true | The %driftauction_...% placeholders. |
Settings
Everything is under auction in config.yml, each with a note:
| Setting | Default | What it does |
|---|---|---|
min-price, max-price | 1, 1000000000 | Prices allowed |
listing-hours, bid-hours | 48, 24 | How long listings and auctions stay up |
listing-limit | 5 | Listings up at once (driftauction.listings.<n> for more) |
listing-fee-percent, listing-fee | 0, 0 | Charged when listing |
sales-tax-percent | 5 | Taken from what the seller gets |
min-bid-increase, min-bid-increase-percent | 1, 5 | How much each bid has to beat the last by |
anti-snipe-seconds | 60 | A bid this close to the end pushes the end back |
sell-cooldown-seconds | 0 | Time between listings |
block-creative | true | No selling from creative or spectator |
blocked-items | command blocks, barriers... | Items that can't be sold |
broadcast-new-listings | false | Tell everyone about new listings |
economy.currency picks the money: empty for the Vault economy, or a DriftEconomy currency's name. DriftEconomy
currencies are whole numbers, so prices are too.
Can't be exploited
- Each step happens once:
- Every step that moves an item or money is one database transaction that only one player, and one server, can win: buying, bidding, a listing ending, cancelling and staff removal.
- Two people clicking the same listing at the same moment can't both get it; the one who loses gets their money straight back.
- A player can only do one thing at a time, so a double click can't sell, buy or bid twice.
- Selling:
- The item leaves the seller's hand before the listing is saved. If the listing can't be saved, it comes back through the collection box with the fee.
- Sellers can't buy or bid on their own listings.
- A listing can't be taken back once someone has bid, so a winning bid can't be pulled out from under someone.
- Bids:
- Bid money is taken when the bid is placed, so the winner can always pay.
- A bid only goes in if nobody else bid in the meantime.
- The bid it beats is given back.
- Delivery: items only ever move through the collection box, and money to sellers through payouts. Each one is removed from the database before it's given, so it can't be given twice, and a failed payment is tried again.
- Logging out mid-trade: nothing is lost. The item waits in the collection box, and money goes back by UUID.
- Prices: anything that isn't a real number, is below the minimum or above the maximum is refused. Prices are rounded to cents, or whole numbers for DriftEconomy.
- What can be sold: nothing from creative or spectator (where items can be made from nothing), and no blocked items, including inside shulker boxes and bundles.
- Locked menus: nothing can be taken out of any menu, and the shulker box preview is look-only.
PlaceholderAPI
| Placeholder | What it shows |
|---|---|
%driftauction_listings% | The player's listings up for sale |
%driftauction_collection% | Items waiting in their collection box |
Configuration files
| File | What's in it |
|---|---|
config.yml | Feature switches, the currency, the auction rules and storage |
commands.yml | Command names, aliases and permissions |
messages.yml | Every message, in MiniMessage |
menus.yml | The auction house, your listings and the collection box |
Every file starts with a boxed header saying how to apply changes, is split into sections, and has a note above
every option saying what it does, its unit and the values it takes. The prefix is DRIFTAUCTION in bold solid lime (#a3e635), followed by a dark grey ».
When you update, new options are added with their notes and everything you changed is kept. When the notes
themselves change, each file is rebuilt once with the new notes and your values written back in; the old file is
kept in data/backups/. Messages you never changed get the new default wording.
Mistakes in the files
A value DriftAuction can't use never stops the plugin. The console says which file and option, what was wrong and what is used instead, for example:
[DriftAuction] config.yml: auction.sales-tax-percent 150 is above 100, using 100
/driftauction reload tells you how many problems it found, so you know to look.
Folder layout
plugins/DriftAuction/
config.yml settings, starting with the features: switches
messages.yml every message
menus.yml every menu
commands.yml command names, aliases and permissions
data/ the plugin's own files, no need to open them
database.mv.db listings, bids, sales and the collection box (H2 storage)
backups/ old copies of files DriftAuction replaced
*.version which version of each file you have
Older versions kept auction.mv.db and the .version markers next to config.yml. They are moved into data/ the first time the new version
starts (one console line per file), and nothing is overwritten or deleted.