Make sure the KeepInventory gamerule is set to FALSE in ALL DIMENSIONS, otherwise it won't work as intended!
Are you tired of arguing with your friends about whether to turn KeepInventory on? I'm sure you've never done that before.. but just in case, I made a plugin.
SMARTDEATH is a simple and lightweight plugin for Survival servers. When a player dies, it determines whether the death was caused by another player or by a natural causes.
- If the player was attacked by another player within 5 seconds of them dying, they will drop their items.
- If the player dies by any other cause, they will keep everything upon respawning.
Because this plugin is super lightweight, it supports almost anything you add to it. The code requires no beforehand setup, allowing for a plug-and-play experience! Many hours were spent testing this to make sure it worked flawlessly and bug free.
You have free use to modify this plugin however you want. Feel free to decompile it, play with the code, or redistribute it as you please.