DriftVaults
Extra storage behind /pv, with a paper trail.
Player vaults for Paper 26.3: extra storage players open with /pv, with a vault menu, pages, sharing, backups,
an item log and network sync. Part of DriftSuite.
Features
- The vault menu:
/pvshows every vault with its name, icon and how full it is, plus a few locked ones. Vaults kept from a rank the player lost stay safe and show as locked. - Vaults by rank: the number of vaults, rows (1 to 6) and pages come from the defaults, groups in
config.ymlor permissions likedriftvaults.amount.5. Vaults with more than one page show 45 slots a page with page buttons. - Names and icons:
/pv rename(colours with a permission) and/pv icon(the item in your hand). - Every item kept whole: items are stored in Paper's own format, so enchantments, names, shulker contents and other plugins' data all stay.
- No duping:
- A vault is only ever open for one person, on one server.
- It's saved when it's closed, every minute while it's open and before the server stops.
- A crashed server's locks run out by themselves.
- Buying: buy more vaults or rows with money or any DriftEconomy currency. Prices can go up with each one bought.
- Rules:
- Vaults can be closed off in some worlds, in creative and spectator, during combat (DriftCombat) and by a cooldown.
- Blocked items, and optionally shulker boxes and bundles, can't be put in.
- Search, sort and deposit:
/pv searchfinds an item across every vault, inside shulker boxes and bundles too./pv sorttidies a vault./pv depositmoves in everything you carry that the vault already has.
- Shared vaults:
/pv trustlets a friend use one of your vaults, or only look in it. - Staff tools:
- Open anyone's vaults, online or not, view-only or editable.
- Empty vaults.
- Roll a vault back to a backup.
- Read the log of what was put in and taken out and by whom.
- Network sync: with MySQL or MariaDB, vaults are the same on every server, and the lock stops the same vault being open on two servers.
- Importing: brings vaults over from PlayerVaultsX and AxVaults.
- Extras: PlaceholderAPI placeholders, a developer API with open and close events, and a Vaults button in
DriftStaff's
/checkmenu. - Folia supported.
Requirements
- Paper (or a fork) 26.3, Java 25
- Optional: Vault with an economy plugin, or DriftEconomy, for prices
- Optional: DriftCombat, to keep vaults shut during combat
- Optional: PlaceholderAPI
Installation
- Put
DriftVaults-<version>.jarinplugins/and start the server. It works without any changes and keeps its database inplugins/DriftVaults/data/(see Folder layout). - Set how many vaults each rank gets under
limits.groupsinconfig.yml, and give ranksdriftvaults.group.<name>. - For a network, set
storage.type: MYSQLon every server, and give each one a differentstorage.server-name. - Coming from another vault plugin? See Moving from another vault plugin.
Commands
The main command is /pv (also /vault, /vaults, /playervault, /playervaults). Names, aliases and
permissions can be changed in commands.yml.
| Command | What it does | Permission |
|---|---|---|
/pv | Open the menu of your vaults | driftvaults.use |
/pv <number> | Open one of your vaults | driftvaults.use |
/pv rename <number> <name|reset> | Name a vault | driftvaults.use |
/pv icon <number> [reset] | Use the item in your hand as the vault's icon | driftvaults.use |
/pv buy <vault|row> | Buy another vault, or another row in every vault | driftvaults.use |
/pv search <item> | Find which vaults hold an item | driftvaults.use |
/pv sort <number> | Join up stacks and put a vault in order | driftvaults.use |
/pv deposit <number> | Move everything you carry that the vault already has into it | driftvaults.use |
/pv trust <number> <player> [edit|view] | Share a vault with a friend | driftvaults.use |
/pv untrust <number> <player> | Stop sharing it | driftvaults.use |
/pv trusted <number> | Who a vault is shared with | driftvaults.use |
/pv shared | Vaults other players shared with you | driftvaults.use |
/pv <player> <number> | Open a vault shared with you (or, for staff, anyone's) | driftvaults.use |
/pv log <number> [page] | What was put in and taken out of your vault, and by whom | driftvaults.use |
/pv <player> | Staff: the menu of all of a player's vaults | driftvaults.admin.view |
/pv clear <player> <number|all> | Staff: empty vaults (asks first, keeps a backup) | driftvaults.admin.clear |
/pv backups <player> <number> | Staff: list a vault's backups | driftvaults.admin.backups |
/pv backup view <id>, /pv backup restore <id> | Staff: look at a backup, or roll back to it | driftvaults.admin.backups, .restore |
/pv log <player> <number> [page] | Staff: anyone's vault log | driftvaults.admin.logs |
/driftvaults <reload|version|import|help> (/dvaults) | Admin commands (help lists them, click a line to fill it in) | driftvaults.admin |
Permissions
| Permission | Default | What it allows |
|---|---|---|
driftvaults.use | everyone | Use /pv and your own vaults. |
driftvaults.group.<name> | nobody | The vaults, rows and pages of that group in limits.groups. |
driftvaults.amount.<n> | nobody | At least n vaults. |
driftvaults.amount.unlimited | nobody | As many vaults as vaults.max-vaults allows. |
driftvaults.size.<rows> | nobody | At least that many rows in each vault (1 to 6). |
driftvaults.pages.<n> | nobody | At least n pages in each vault. |
driftvaults.rename.color | op | Use colours (&c, <red>, <gradient:...>) in vault names. |
driftvaults.admin.view | op | Look in anyone's vaults, online or not. |
driftvaults.admin.edit | op | Change what's in anyone's vaults (includes .view). |
driftvaults.admin.clear | op | Empty a player's vaults. |
driftvaults.admin.backups | op | List and look at vault backups. |
driftvaults.admin.restore | op | Roll a vault back to a backup (includes .backups). |
driftvaults.admin.logs | op | Read anyone's vault log. |
driftvaults.admin | op | /driftvaults reload, version and import. |
driftvaults.bypass.rules | op | Open vaults in any world or game mode, during combat and without the cooldown. |
driftvaults.bypass.blocked-items | op | Put blocked items in vaults. |
driftvaults.bypass.cost | op | Buy vaults and rows for free. |
How many vaults, and how big
A player gets the highest of:
vaults.default-amount,default-rowsanddefault-pagesinconfig.yml;- every group under
limits.groupsthey havedriftvaults.group.<name>for; - any
driftvaults.amount.<n>,driftvaults.size.<rows>ordriftvaults.pages.<n>permission.
Vaults and rows they bought are added on top of that.
limits:
groups:
vip:
vaults: 3
rows: 6
mvp:
vaults: 5
rows: 6
pages: 2
A vault with one page is a chest of 1 to 6 rows. With more than one page, each page holds 45 slots and the bottom row has the page buttons (and Sort and Deposit buttons).
If a vault gets smaller, nothing is lost. This can happen when a player loses a rank. The items in slots it no longer has stay saved, and the player is told about them. A whole vault they no longer have shows in the menu as locked, with its items kept safe.
Turning features on and off
The features section at the top of config.yml turns whole parts of the plugin on or off. Changes need a restart.
| Switch | Default | What it covers |
|---|---|---|
menu | true | /pv on its own opens a menu of every vault. Off, it opens vault 1. |
names | true | /pv rename and /pv icon. |
prices | false | Buying vaults and rows. Prices are under economy. |
search | true | /pv search. |
sort-and-deposit | true | /pv sort, /pv deposit and their buttons. |
sharing | true | /pv trust, untrust, trusted and shared. |
staff-tools | true | Staff opening and emptying other players' vaults. |
backups | true | Copies of vaults to roll back to. Settings under backups. |
logs | true | The log of what was put in and taken out. Settings under logs. |
sounds | true | A sound when a vault opens and closes. |
rules | true | The rules under rules: worlds, game modes, combat, cooldown and blocked items. |
placeholders | true | The %driftvaults_...% placeholders. |
Keeping items safe
- One person at a time:
- Only one player has a vault open at a time, on one server.
- Anyone else trying gets told who's using it.
- On a network, a lock in the database does the same across servers.
- Each server checks in every 10 seconds, so after a crash its locks run out within a minute.
- When vaults are saved:
- as soon as a vault is closed, including when the player logs out;
- every
vaults.autosave-seconds(60) while it's open; - before the server stops. The database waits for every save to finish before it closes.
- Locked slots: the page buttons can't be moved, and items can't be pulled out of them by double-clicking.
- View-only vaults (shared with
view, or staff with onlydriftvaults.admin.view) can't be changed at all.
Buying vaults and rows
Turn on features.prices, then set the prices:
economy:
# Empty for the Vault economy, or a DriftEconomy currency's name, like gems.
currency: ""
buy-vault:
price: 5000
increase: 2500 # each one bought costs this much more than the last
max: -1 # how many can be bought, -1 for no limit
buy-row:
price: 10000
increase: 5000
max: -1
Players buy with /pv buy vault or /pv buy row, or by clicking a locked vault in the menu. They confirm in a
pop-up first. Bought vaults and rows are kept for good and add to what their rank gives.
Sharing a vault
/pv trust 1 Stevelets Steve use your vault 1./pv trust 1 Steve viewonly lets him look.- He opens it with
/pv <you> 1, or from/pv shared, and he's told when you share one with him. /pv untrust 1 Stevetakes it back, and/pv trusted 1shows who has access./pv log 1shows who put in and took what.
Staff tools, backups and logs
- Opening vaults:
/pv <player>opens the menu of all of a player's vaults, and/pv <player> <number>opens one.- This works whether the player is online or not.
driftvaults.admin.viewonly looks;driftvaults.admin.editcan move items.
- Emptying vaults:
/pv clear <player> <number|all>empties vaults after a confirm pop-up. A backup is kept first. - Backups:
- When a vault is closed after something changed, a copy of how it was before is kept. That's at most one every
backups.interval-minutes(30) per vault, and the newestbackups.keep(10) are kept. /pv backups <player> <number>lists them, each with [View] and [Roll back] buttons.- Rolling back keeps a copy of the vault as it was first.
- When a vault is closed after something changed, a copy of how it was before is kept. That's at most one every
- Logs:
- Every change is logged when a vault closes: who, what, how many and when.
/pv log <player> <number>reads it, and owners can read their own with/pv log <number>.- Entries are kept for
logs.keep-days(30).
- DriftStaff: with DriftStaff installed, its
/checkmenu has a Vaults button.
Moving from another vault plugin
- Install DriftVaults next to the old plugin and start the server once.
- Run one of these:
/driftvaults import playervaultsreadsplugins/PlayerVaults/newvaults/./driftvaults import axvaultsreads AxVaults' SQLite (data.db) or H2 database, with each vault's icon. AxVaults on MySQL isn't supported: switch it to SQLite first.
- Remove the old plugin and restart.
Vaults DriftVaults already has items in are never overwritten. Items that can't be read are skipped and counted. Both plugins store items in Paper's format on current servers; items saved on very old server versions might not read. EnderVaults isn't supported, because it stores items in a raw Minecraft format that changes between versions.
PlaceholderAPI
| Placeholder | What it shows |
|---|---|
%driftvaults_vaults% | How many vaults the player has |
%driftvaults_rows%, %driftvaults_pages% | Rows and pages in each vault |
%driftvaults_slots% | Slots in each vault |
%driftvaults_used% | Slots used across every vault |
%driftvaults_percent% | How full their vaults are, in percent |
%driftvaults_used_<number>% | Slots used in one vault |
%driftvaults_bought_vaults%, %driftvaults_bought_rows% | What they bought |
Developer API
DriftVaultsAPI vaults = DriftVaultsAPI.get(); // null when DriftVaults isn't enabled
int count = vaults.vaultCount(player);
vaults.open(player, 1);
vaults.contents(uuid).thenAccept(byNumber -> { /* a copy of every vault's items */ });
VaultOpenEvent fires before a vault opens and can be cancelled. VaultCloseEvent fires when one closes, with its
contents.
Configuration files
| File | What's in it |
|---|---|
config.yml | The feature switches at the top, vault sizes, groups, prices, rules, backups, logs, sounds and storage |
commands.yml | Every command's name, aliases, permission and usage |
messages.yml | Every message, in MiniMessage |
menus.yml | The /pv menu, the vault titles and the page bar |
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 DRIFTVAULTS in bold solid bronze (#cd7f32), 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 DriftVaults can't use never stops the plugin. The console says which file and option, what was wrong and what is used instead, for example:
[DriftVaults] config.yml: vaults.default-rows 9 is above 6, using 6
/driftvaults reload tells you how many problems it found, so you know to look.
Folder layout
plugins/DriftVaults/
config.yml settings, starting with the features: switches
messages.yml every message
menus.yml every menu
commands.yml command names, aliases and permissions
data/ DriftVaults' own files, no need to open them
database.mv.db the vaults, backups and logs (H2 storage)
backups/ old copies of files DriftVaults replaced
*.version which version of each file you have
Older versions kept vaults.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.