Overview
WGInventorySave is a lightweight Bukkit/Spigot plugin that integrates seamlessly with WorldGuard to automatically save and restore player inventories when entering or exiting designated regions. This is perfect for servers with creative zones, minigames, or restricted areas where you want to prevent item exploitation while allowing players to switch gamemodes or access special features.
The plugin adds a custom WorldGuard flag called inventory-save. When enabled on a region, it captures a snapshot of the player's main inventory, armor, offhand, and ender chest upon entry. On exit (with a configurable delay), it restores everything to its original state, overwriting any changes made inside. This helps combat abuse, such as filling inventories in creative mode and smuggling items out.
Key use cases:
Features
Configuration
Currently hardcoded, but future updates may add config.yml for:
WGInventorySave is a lightweight Bukkit/Spigot plugin that integrates seamlessly with WorldGuard to automatically save and restore player inventories when entering or exiting designated regions. This is perfect for servers with creative zones, minigames, or restricted areas where you want to prevent item exploitation while allowing players to switch gamemodes or access special features.
The plugin adds a custom WorldGuard flag called inventory-save. When enabled on a region, it captures a snapshot of the player's main inventory, armor, offhand, and ender chest upon entry. On exit (with a configurable delay), it restores everything to its original state, overwriting any changes made inside. This helps combat abuse, such as filling inventories in creative mode and smuggling items out.
Key use cases:
- Creative build zones in survival servers.
- Event arenas where players get temporary items.
- Lobby regions with special permissions.
Features
- Custom WorldGuard Flag: Use /rg flag <region> inventory-save allow to enable saving/restoring for any region.
- Comprehensive Inventory Saving: Captures and restores:
- Main inventory (36 slots).
- Armor (4 slots).
- Offhand (1 slot).
- Ender chest (27 slots) to prevent ender chest abuse.
- Automatic Restore on Exit: Restores after a 5-second delay (to prevent rapid entry/exit exploits). The delay is hardcoded but can be adjusted in code.
- Logout/Login Handling: If a player quits while inside the region and logs back in outside (e.g., at spawn), the inventory is restored on join. This ensures consistency even on disconnects.
- YAML File Storage: Saves per-player data in plugins/WGInventorySave/inventories/ and player_states/. Files are deleted after restore to save space.
- Logging and Messages: Console logs entry/exit events; players get chat messages like "Your inventory has been saved/restored."
- No Item Loss: Copies (doesn't clear) inventories by default—players keep their items inside, but restores override changes on exit.
- Lightweight and Efficient: Uses Bukkit events and YAML for minimal performance impact.
- WorldGuard (7.0.12+): Required for region detection and custom flag.
- WorldEdit (7.3.8+): Required by WorldGuard for selections.
- No other plugins needed (e.g., no LuckPerms or Vault).
- Download the JAR from [SpigotMC link or your build].
- Place WGInventorySave.jar in your server's plugins/ folder.
- Ensure WorldGuard and WorldEdit are installed and up-to-date.
- Restart your server (/restart or stop/start).
- Check latest.log for "[WGInventorySave] WGInventorySave enabled."
- Create or select a region with WorldGuard (e.g., /rg define cloudy).
- Add an owner if needed: /rg addowner cloudy <playername>.
- Enable the flag: /rg flag cloudy inventory-save allow.
- (Optional) Set other flags like gamemode creative for inside the region.
- Test: Enter the region—inventory saves. Exit—wait 5 seconds, inventory restores.
Configuration
Currently hardcoded, but future updates may add config.yml for:
- Restore delay.
- Toggle clearing on entry.
- Custom messages.
- No custom permissions or commands—relies on WorldGuard's flag system.
- Admins need WorldGuard permissions (e.g., worldguard.region.flag.*) to set the flag.
- Restore delay is fixed at 5 seconds (adjust in code if needed).
- Doesn't handle teleportation in/out (only movement)—add if requested.
- Files are per-player; large servers may need cleanup cron.
- Tested on PaperMC 1.21.1.
- Report issues on [GitHub/Spigot forum link].
- Suggestions welcome—e.g., config file or economy integration.
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.21
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
WGInventorySave 1.0 is a free Minecraft Java mod. Compatible with Minecraft 1.21. Downloaded 43 times (via Spigot). Download it and open it directly in the game.