This may already exists somewhere, in which case a link to it would be nice, but I'd like a plugin which returns to the console how someone died and who died whenever a death occurs. I ghost quite a bit, and its irritating only seeing 'respawn triggered'.
should be extremely easy. I'll check around first to see if it exists, although I do not think so EDIT: my 5 searches only showed up 8 results, and none were of this type, only thing close was HeroicDeath. I can start on this if no one else wants. Estimated Time: 15-30 minutes EDIT 2: finished, testing now
I have a custom plugin that does this, as well as a mysql logging, and death announcing. If all you want is for it to log to console. I can remove some code for you. Unless DreadKyller does it first =p
the only problem I'm having is that with lava and fire damage killing you it prints several times to the console and not only once... but only if no monsters, it's because of the regeneration of health...
the problem is, onEntityDeath does not have a getCause, therefore I have to use onEntityDamage() and see if the player health minus the damage that will be applied is<=0 (death), if so then based on the cause print something.
Use onEntityDamage() to keep track of what did the most recent damage to the player. Then when they die, check the list for that player, and see what did the damage. Ive stripped down the code from mine that does this. I cant take credit for some of it, i got parts from a plugin i dont remember the name of. http://pastebin.com/FuJ1YN2x and the whole cut down source if you want to check it out. http://www.mcspazzy.com/minecraft/plugins/McDeath/consolesrc/
Oo, I completely forgot that there is a thing called player.getLastDamageCause(), I'm so fkin dumb... that makes it a lot easier, on deatch do exactly like I have it, only from the "LastDamageCause" of the player. EDIT: completed but I g2g, I'll post tomorrow
ok, this is getting really strange, I have this: Code:java public void onEntityDeath(EntityDeathEvent event){ if(event.getEntity() instanceof Player){ Player p = (Player) event.getEntity(); DamageCause cause = p.getLastDamageCause().getCause(); if(cause==DamageCause.LAVA){ System.out.println("Player "+p.getDisplayName()+" died in lava at "+p.getLocation.getX()+" ,"+p.getLocation.getY()+" ,"+p.getLocation.getZ()); else if... else if... else{ System.out.println("player"+p.getDisplayName()+" died by "+cause.name()+" at "+p.getLocation.getX()+" ,"+p.getLocation.getY()+" ,"+p.getLocation.getZ()); } }} at first I did not include the last line and I went to try dieing in lava, and no messsage appeard, kept trying, still nothing, I added that line and I got "player DreadKyller dies by LAVA at 45, 72, 263" so I don't get why it did not work as it was supposed to. I'm going to use the strings to compare now...