So when you die, certain things happen. Your items drop. Your body disappears. Et cetera. How would I override these things?
EntityDeathEvent doesn't implement cancellable, so you can't cancel the death. You can, however, change the drops and such, and you can even detect respawn and make it as though the player did't die.
have a look at the APIdocs. examples: EntityDeathEvent: event.getDrops().clear() will remove all drops PlayerRespawnEvent: set respawn position to the player's current location to make the player spawn where he died.
I tried changing respawn location, but doing it using respawn event didn't work all that well. Instead, look for PlayerMoveEvents and then check if that player just died, if so cancel the movement. (Thus bringing them back to their death spot)
Either the Bukkit team is to dumb/didn't implement it, or you have a plugin which sets the respawn position after yours, so your setting is overridden.
Oh. Looking back I may be talking about the wrong thing. In the plugin I did this in, it was setting the players inventory, not changing respawn location. Carry on, now!