MySQL Vault
A virtual storage plugin for Unturned that lets players store items in vaults that persist across server restarts and can be shared between multiple servers.
What it does
Players can open virtual storage containers (vaults) to store their items safely. Each vault has a specific size and can be accessed with commands. The plugin supports different vault sizes for different player ranks and can store data in either MySQL databases or JSON files.
Commands
Player Commands
/vault
- Opens your default vault or the last vault you used/vault <name>
- Opens a specific vault (like/vault vip
)/vaults
- Shows all vaults you can access/trash
- Opens a temporary trash container where items disappear when closed/fixvault
- Removes broken items from your vaults (useful after removing mods)
Admin Commands
/migratevaults
- Moves all vault data between MySQL and JSON storage (console only)
Configuration
The plugin creates a configuration file with these settings:
Basic Settings
- MessageColor - Color of chat messages (like "yellow", "red", "green")
- DatabaseProvider - Choose "mysql" for database storage or "json" for file storage
- ConnectionString - Your MySQL database connection info (only needed for MySQL)
- VaultsTableName - Name of the database table (default: "Vaults")
Vault Settings
- TrashHeight/TrashWidth - Size of the trash container (default: 10x8)
- OpenBiggestVault - If true,
/vault
opens your largest available vault instead of the last used one
Vault Types
Define different vault sizes in the <Vaults>
section:
<Vault Name="default" Width="3" Height="4" />
<Vault Name="vip" Width="5" Height="6" />
<Vault Name="premium" Width="8" Height="10" />
Permissions
Give players access to specific vaults using these permissions:
vault.default
- Access to the default vaultvault.vip
- Access to the VIP vaultvault.premium
- Access to the premium vault
Players without any vault permissions can still use the default vault.
How to use
For players: Use
/vault
to open your storage. Items placed inside will be saved when you close it.For admins: Set up different vault sizes for different player groups. Give VIP players the
vault.vip
permission to access larger vaults.Switching storage types: Create a file named "migrate" in the plugin folder and restart the server, OR use the
migratevaults
console command to automatically transfer all vault data between JSON and MySQL storage.
Example Configuration
<?xml version="1.0" encoding="utf-8"?>
<MySQLVaultConfiguration>
<MessageColor>yellow</MessageColor>
<DatbaseProvider>json</DatbaseProvider>
<ConnectionString>Server=localhost;Database=unturned;User Id=root;Password=yourpassword;</ConnectionString>
<VaultsTableName>PlayerVaults</VaultsTableName>
<TrashHeight>8</TrashHeight>
<TrashWidth>6</TrashWidth>
<OpenBiggestVault>true</OpenBiggestVault>
<Vaults>
<Vault Name="default" Width="4" Height="4" />
<Vault Name="donator" Width="6" Height="6" />
<Vault Name="vip" Width="8" Height="8" />
</Vaults>
</MySQLVaultConfiguration>
Storage Options
JSON Storage: Simple file-based storage. Good for single servers or small communities. Data is saved in a JSON file in your map's level folder. For example, if you're using the Washington map, the file will be at Servers/unturned/Level/Washington/MySQLVault.json
. The file is automatically saved whenever the server saves and when the server shuts down.
MySQL Storage: Database storage that can be shared between multiple servers. Good for networks where players should access the same vaults on different servers.