Diamond Vault

Diamond vault, payments and auction house for your Minecraft server – paid in diamonds.

Download the plugin

What it does

Version 0.1.0-SNAPSHOT for Minecraft 26.3 (Paper, Java 25, registered as Folia-compatible). Early version: tested automatically (331 tests, start on Paper 26.3) but not yet tried much in the game.

  • Diamond vault (/dv, /diamant): store diamonds and diamond blocks and take them out again. Counted in whole diamonds (1 block = 9).
  • Auction house (/shop, /ah): players list items at a fixed price or as an auction with bids, others buy them. Payment comes from the vault.
  • Payments between players (/pay), shop tiers (Basic, Premium, Ultra) by permission, categories, sorting, search, a block list and a live view (sold listings disappear for everyone at once).
  • A small read-only API for your website (off by default).
  • Not included: buy-it-now for auctions and entering prices by chat.

Installation

  1. Download the file DiamondVault.jar on the download page under "Other".
  2. Put it into the plugins/ folder of your server (Paper 26.3, Java 25).
  3. Restart the server. The settings are then in plugins/DiamondVault/config.yml, the data in plugins/DiamondVault/vault.db.

A permissions plugin (for example LuckPerms) is not required, the defaults are enough.

Commands for players

/dv, /diamantopens the vault chest
/dv deposit <Menge|all>deposit diamonds from your inventory (all = all diamonds and blocks)
/dv withdraw <Menge|all> [blocks]withdraw; with blocks you get whole blocks (the rest as single diamonds)
/dv balancebalance, size and fill level
/dv history [Anzahl]your bookings, newest first (default 10, at most 50), including purchases, sales and fees
/balance, /bal, /guthabenyour balance, how much is free and how much is reserved by bids; /balance <player> only with permission
/pay <Spieler> <Menge>pays diamonds from your vault to a player (also offline, they must have joined once); from pay.confirm-above add confirm at the end
/paytoggleblocks or allows payments to you
/shop, /ah, /auktionshausopens the auction house
/shop search <Begriff>searches the listings (name, type, seller; all words must match); without a term the search is cleared
/shop sell <Preis>lists the item in your hand for this price (whole stack); /shop sell without a price opens the listing window
/shop sell <Preis> auction [Stunden]lists it as an auction (starting bid, duration from the list in the configuration, default 24)
/shop mineyour listings (a click withdraws)
/shop claim [all]pick-up as a window; all takes everything that fits into your inventory
/shop historypurchases, sales and fees only

The vault

  • The upper area shows your diamonds: single chest 3 rows, double chest 5 rows. Diamond blocks start at the first slot, single diamonds (0 to 8) always sit in the last slot. A control row at the bottom: "Deposit all", the balance, "Withdraw all".
  • Deposit: put diamonds or blocks into the chest (click, right-click for one, drag, shift-click, number key) or use "Deposit all". Withdraw: click a stack and it goes to your inventory; "Withdraw all" pays out as much as fits. For exact amounts use /dv withdraw <amount>.
  • Only diamonds and blocks without a name, enchantment or lore count. If your inventory is full nothing is lost: the rest stays in the vault.
  • The window is display only: double-click, dragging, Q or shift cannot create anything. What you see is always built from the booked balance.
  • Size: single chest at most 14,984 diamonds, double chest at most 25,352. If the content is above the limit (for example after a permission was removed) nothing is lost; you just cannot deposit until it is below.

Auction house and shop tiers

  • Buying: /shop, click a listing, "Buy". The price is booked from the vault at once, the item goes to your inventory (otherwise to the pick-up). You cannot buy your own listings.
  • Listing: "Sell" or /shop sell, click an item, set the price with the buttons −1000 to +1000. The bottom shows what you get after the fee. Only "List" takes the item out of your inventory. The price applies to the whole stack.
  • Sold: you get the price minus the fee in your vault and a message (offline: at your next join). A full vault never blocks a sale. Listings expire after the set time (default 7 days) and the item then waits in the pick-up.
  • Filters: at the bottom of the auction house: category (blocks, tools and weapons, armor, food and potions, books, miscellaneous), sorting (newest, oldest, price, ending soon) and search.
  • Auctions: the price is the starting bid. A bid is reserved in your vault: you cannot spend those diamonds but they are still yours (see /balance). If you are outbid they are free again at once. A new bid has to exceed the highest by auction.increment-percent (at least 1 diamond); a bid in the last minutes extends the auction. At the end the highest bidder gets the item and the seller the price minus the fee. An auction with bids cannot be withdrawn.
  • Shop tiers: shop.max-listings and shop.fee-percent apply to everyone ("Basic"). premium (10 listings, 3 % fee) and ultra (25 listings, 1 % fee) are included; you add more under shop.tiers. A tier is given to whoever has the permission diamondvault.shop.tier.<name> or whom an admin gives it with /dvadmin tier. With several, the best applies. The fee applies as it was when the item was listed.
  • Default rules: fee 5 % of the price (rounded down to whole diamonds), 5 listings per player at a time, price from 1 to 100,000 diamonds.

Permissions

diamondvault.useuse the vault – everyone
diamondvault.shopuse the auction house – everyone
diamondvault.pay/pay and /paytoggle – everyone
diamondvault.balance/balance (own balance) – everyone
diamondvault.balance.others/balance <player> – operators only
diamondvault.shop.tier.<Name>shop tier from the configuration (for example .premium, .ultra) – nobody
diamondvault.size.doublevault as a double chest (5 rows, 25,352 diamonds) – nobody
diamondvault.admineverything of the administration (includes admin.view, admin.adjust, admin.size, admin.shop, balance.others) – operators only
diamondvault.admin.viewview balances, histories, other vaults, open operations, the audit log
diamondvault.admin.adjustbook corrections, clear vaults
diamondvault.admin.sizeset the size of a vault
diamondvault.admin.shopview, remove and destroy listings, block list, tiers

There is no diamondvault.*; for "everything" use diamondvault.admin. The double chest applies if the permission diamondvault.size.double is present or an admin set it with /dvadmin size; removing the permission never takes diamonds away. Examples (LuckPerms syntax):

/lp group vip permission set diamondvault.size.double true
/lp group moderator permission set diamondvault.admin.view true
/lp group admin permission set diamondvault.admin.adjust true
/lp group admin permission set diamondvault.admin.shop true
/lp group default permission set diamondvault.shop false   # Auktionshaus für alle sperren / lock the auction house for everyone

Administration (/dvadmin)

Wherever a player is needed you can use name or UUID. A name is recognized if the player is online or has been on the server before. From the console and via RCON the commands answer at once.

/dvadmin balance <Spieler>balance, reserved by bids, stored size, open operations (admin.view)
/dvadmin history <Spieler> [Anzahl]full history with time, kind, amount, admin, reason (admin.view)
/dvadmin open <Spieler>the vault as a read-only view, in game only, is logged (admin.view)
/dvadmin pending [Spieler]stuck withdrawals; without a player all older than 5 minutes (admin.view)
/dvadmin audit [Spieler]audit log: who changed what for whom and when (admin.view)
/dvadmin adjust <Spieler> <+Menge|-Menge> <Grund>correction; the reason is mandatory, the balance cannot fall below 0 (admin.adjust)
/dvadmin clear <Spieler> [confirm]clears the vault (first a prompt with the amount, then with confirm); booked as a correction (admin.adjust)
/dvadmin size <Spieler> single|doublesets the stored size permanently (admin.size)
/dvadmin shop list [Spieler]active listings with number, seller, item, price, remaining time (admin.shop)
/dvadmin shop remove <id>takes a listing out of the shop; the item waits in the seller's pick-up (admin.shop)
/dvadmin shop destroy <id> [confirm]destroys the item for good (first a preview, then with confirm); the record stays in the database (admin.shop)
/dvadmin shop block|unblock <Gegenstand|hand>, blockedblock list: blocked items (for example bedrock) cannot be listed, existing listings stay (admin.shop)
/dvadmin tier <Spieler> <Stufe|none>gives a player a shop tier permanently or removes it (admin.shop)

Nothing is deleted. Corrections, clearing, removing and destroying are records; every administrative change is in the audit log (/dvadmin audit) with the admin (via RCON admin:Rcon). The seller is not notified at once on remove and destroy; they see the pick-up at their next join.

Configuration

File plugins/DiamondVault/config.yml. Changes apply after a restart. Invalid values switch the plugin off with a clear message in the log: it never starts with a wrong setting.

languagede or en; the texts are in lang/de.yml and lang/en.yml (MiniMessage) and can be changed
capacity.single, capacity.doubleupper limit in diamonds; 0 = as much as fits into the chest (recommended)
history-lineslines of /dv history (1 to 50, default 10)
shop.fee-percentfee in percent (0 to 50, default 5), rounded down
shop.lifetime-dayshow long a listing stays (1 to 365, default 7)
shop.max-listingslistings per player at a time (1 to 100, default 5)
shop.max-pricehighest price of a listing in diamonds (default 100000)
shop.tiers.<Name>.max-listings, .fee-percenta shop tier (name only a-z 0-9 _ -); included: premium 10 / 3, ultra 25 / 1
pay.enabled, pay.confirm-abovepayments on/off; from this amount on you have to add confirm (0 = never)
auction.enabledauctions on/off
auction.increment-percenta new bid must exceed the highest by this many percent (default 5, at least 1 diamond)
auction.extend-minutesextension for a bid in the last minutes (default 2, 0 = never)
auction.durations-hoursselectable durations, default [1, 6, 12, 24, 72, 168]
api.enabled, api.host, api.port, api.tokenread-only API (off, 127.0.0.1, 8765, empty), see below
sqlite-filefile name of the database (a name only, ends in .db, default vault.db)

Read-only API for a website

Off by default. To turn it on set api.enabled: true and a token of at least 16 characters (for example openssl rand -hex 24), then restart the server. Without a long token it does not start. Every call needs Authorization: Bearer <token>.

GET /v1/statsnumber of accounts, total balance, reserved, active listings
GET /v1/top?limit=10the largest accounts (at most 100)
GET /v1/accounts?limit=100&offset=0all accounts page by page (at most 500)
GET /v1/balance/<UUID|Name>balance, reserved, available and size of a player

Security: read-only (everything except GET is rejected), bound to 127.0.0.1 only, at most 30 requests per second, no error texts to the outside. Query it from your website on the same machine (or through an HTTPS proxy), never directly from the visitors' browser, otherwise the token would be public.

Data and operation

  • Database: plugins/DiamondVault/vault.db (SQLite, with -wal and -shm next to it while the server runs). It holds vaults, bookings, the audit log, listings and pick-ups. Backup: stop the server and copy the file(s). The SQLite driver comes from Paper and is not in the jar.
  • Bookings are append-only: the balance is the sum of the bookings, nothing is overwritten or deleted.
  • After a crash: if the server stops in the middle of a deposit, withdrawal, listing or pick-up, the operation is completed or cleanly rolled back at the next join. Either everything is there completely, or it is back in the vault or the inventory, never both and never nothing.
  • Updates: the database is migrated to the new schema at start without data loss. A database newer than the plugin refuses to start.

Known limits

  • The chest, the shop windows and the recovery after a crash are tested automatically but not yet tried much in the real game. Bedrock (Geyser) is untested.
  • The vault chest does not refresh by itself when an admin changes your balance (it rebuilds on every click). The shop windows redraw live; a click on a listing that was just sold reports "That does not exist any more." if someone was faster.
  • The plugin only knows names for /pay and the administration once a player has joined after the update; before that only the UUID works.
  • Auctions have no buy-it-now, bids cannot be withdrawn. "My listings" and "Pick-up" show at most 45 entries. The price is set with buttons, not by chat. An item is always listed as one stack.
  • Expired listings and removals by the administration only reach the seller at their next join. The fee disappears from the game (it goes to nobody).