LagGuard - Inventory Protection for High-Ping Players
Are your players tired of losing their valuable items due to a sudden ping spike? LagGuard is a simple and effective plugin that automatically protects high-ping players by saving and restoring their inventory upon death.
Lag spikes are a common issue, and losing items because of them can be frustrating for players. This plugin acts as a safety net, ensuring a fairer and more enjoyable experience on your server.
Key Features:
- Automatic Inventory Restoration: When a player with high ping dies, their inventory is cleared from the ground and automatically restored to them with a configurable delay.
- Dynamic Ping Thresholds: The plugin uses different ping thresholds for different death types:
- PvP Deaths: If a player dies in a PvP combat with a ping over 500ms, their inventory is restored.
- Non-PvP Deaths: If a player dies from environmental causes (mobs, fall damage, etc.) with a ping over 250ms, their inventory is restored.
- Anti-Dupe System: The SnapshotManager ensures that once an inventory is restored, the temporary snapshot is deleted, preventing item duplication.
- Configurable Delay Time: You can now adjust the time a player has to wait for their items to be restored using the /lagguard setdelay <seconds> command in-game.
- Automatic Configuration File: The config.yml file is now created automatically when the plugin is run for the first time, making setup much easier.
- Informative Messages: Players are notified via chat when their inventory has been restored and are told exactly how long the restoration will take.
- Lightweight & Efficient: The plugin is designed to be as efficient as possible, having a minimal impact on server performance.
How It Works:
- A player dies.
- The plugin checks the player's current ping and whether the death was PvP or not.
- If the ping exceeds the configured threshold, the PlayerDeathEvent is canceled by clearing the item drops.
- The SnapshotManager then restores the player's inventory from a temporary snapshot after the set delay.
- A message is sent to the player, confirming that their items have been saved and the expected restoration time.
Compatibility:
This plugin is designed for Minecraft version
1.16 and
1.21. It may work with other versions, but has not been tested.
Support & Feedback:
If you encounter any bugs or have suggestions for new features, please leave a comment on this page. Your feedback is highly appreciated!
Commands & Permissions:
Command
Description
Permission
/lagguard reload
Reloads the plugin configuration from the config.yml file.
lagguard.admin
/lagguard setdelay <seconds>
Sets the inventory restoration delay time in seconds.
lagguard.setdelay
/laguard restore <player>
Manually restores the inventory of a specified player if they have a saved snapshot.
lagguard.restore
Author:
[ProfesorrRedman]
Version:
1.2.2