Discussion in 'Plugin Development' started by EvilGooD, May 30, 2015.
How I can cancel the event?
What have you tried?
On a PlayerDeathEvent, do e.setKeepInventory(true); The player will then not drop items on death and will keep their inventory.
But I want to prevent a player drops a custom item when he dies, not all items :/
I'm not 100% sure about this, but I think you might be able to clear all items that are not the custom item and then set keepinventory to true. That way, the custom item stays.
@EvilGooD As said, you can set them to keep their inventory, and manually drop the rest of their inventory but the desired item.
Another way would be to remove the item when they die (so it doesn't drop) and give it back once they respawned
Separate names with a comma.