Inventory Weight Plugin is a comprehensive plugin designed to simulate realistic inventory management on your Minecraft server by tracking the weight of items in a player's inventory. With a fully configurable system, each material’s weight is defined in the config.yml file, allowing server owners to tailor the experience to their desired level of realism. The plugin prevents players from picking up or transferring items when their inventory would exceed a configurable maximum weight, thereby adding an extra layer of strategy and challenge to gameplay.
Key Features:
- Configurable Maximum Weight:
The maximum allowed inventory weight is defined in the config.yml (defaulting to 50 if not set), ensuring flexibility for different server types—from survival to roleplay.
- Per-Material Weight Settings:
Each item’s weight is configurable. The plugin reads weight values for each material from the config.yml. If a specific material isn’t defined, a default value (1.0) is applied.
- Dynamic Weight Calculation:
The plugin continuously calculates the total weight of a player’s inventory by iterating through all item stacks (multiplying each item’s weight by its amount). This calculation is triggered on various inventory-related events, such as item pickup, clicks, drags, drops, and even block placement.
- Event Handling for Inventory Actions:
- Item Pickup: Prevents players from picking up items if doing so would exceed the maximum weight.
- Inventory Click and Drag: Monitors manual item movements and shift-clicks to ensure the
inventory weight remains within limits. If an action would push the weight over the maximum, the event is canceled and the inventory is updated accordingly.
- Block Placement and Item Drop: Adjusts the inventory weight when players place blocks or drop items, allowing them to “lighten” their load.
- Persistent Data Storage:
The plugin uses a data.yml file to save each player’s current weight when they leave the server and reloads it upon rejoining, ensuring that inventory weight persists across sessions.
- Real-Time Feedback:
Players receive immediate feedback via ActionBar messages that display their current inventory weight, warning them when their inventory is too heavy.
- Configurable and Expandable:
With its external config files (config.yml for weights and data.yml for persistent storage), the plugin is easy to customize and extend. Server owners can modify weights, maximum limits, and even add support for additional items without altering the plugin’s code.
Ideal for server owners looking to introduce an extra layer of realism and challenge, Inventory Weight Plugin forces players to manage their inventories wisely, making every item pickup and transfer a strategic decision.