Let me set the scene.... A group of players on a server are fighting rigorously to kill the dragon with the last hit. Moments later, the dragon is a mere hit away from death. Some archers shoot a well-aimed shot towards the dragon; meanwhile, some foot soldiers are striking their beefed, enchanted diamonds swords. The sound of victory is played through everyone's headset. And then... it happens. "I did it I killed the dragon!" "bro i got him, you lagged" "Hey my arrow dealt the damage idiots." ... Yeah. The ever unproven bragging right. Until this plugin comes along and shows who killed the dragon (or wither). Perhaps when any dragon or wither is killed on the server, the plugin announces the person who got the last hit. And maybe a list of the players who dealt the most damage and how much damage they dealt. I seriously hope this plugin request is accepted and made by coder(s), on behalf of all Minecraft server players.
*person kills a boss* Chat: "[<plugin name>]: <player who killed the boss> has killed a <boss (dragon or wither)>!" That is what I'm saying would happen.
I actually made something similar to this a while back, here's the source if any of the devs want to modify it for this guys needs. Basically, this code listens to when people kill the ender dragon, and it tracks whoever did the most damage to the dragon, and gives them all the xp Spoiler (Move your mouse to the spoiler area to reveal the content) Show Spoiler Hide Spoiler Code: package com.zack6849.enderdragon; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Logger; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.ThrownPotion; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; /** * Hello world! * */ public class App extends JavaPlugin implements Listener { Logger log; public static Map<String, Integer> damage = new HashMap<String, Integer>(); @Override public void onEnable() { this.log = getLogger(); getServer().getPluginManager().registerEvents(this, this); } @Override public void onDisable(){ damage.clear(); } @EventHandler public void onDamage(EntityDamageByEntityEvent event) { if (event.getDamager() instanceof Player) { if (event.getEntity().getType() == EntityType.ENDER_DRAGON) { Player damager = (Player) event.getDamager(); int damaged = event.getDamage(); if (!damage.containsKey(damager.getName())) { damage.put(damager.getName(), damaged); } else { damage.put(damager.getName(), damage.get(damager.getName()) + damaged); } } } if (event.getDamager().getType() == EntityType.ARROW) { if (event.getEntityType() == EntityType.ENDER_DRAGON) { Arrow a = (Arrow) event.getDamager(); if (a.getShooter() instanceof Player) { Player damager = (Player) a.getShooter(); int damaged = event.getDamage(); if (!damage.containsKey(damager.getName())) { damage.put(damager.getName(), damaged); } else { damage.put(damager.getName(), damage.get(damager.getName()) + damaged); } } } } if (event.getEntityType() == EntityType.SPLASH_POTION) { ThrownPotion potion = (ThrownPotion) event.getEntity(); if (potion.getShooter() instanceof Player) { Player damager = (Player) potion.getShooter(); int damaged = event.getDamage(); if (!damage.containsKey(damager.getName())) { damage.put(damager.getName(), damaged); } else { damage.put(damager.getName(), damage.get(damager.getName()) + damaged); } } } } @EventHandler public void onDeath(EntityDeathEvent event) { if (event.getEntityType() == EntityType.ENDER_DRAGON) { int exp = event.getDroppedExp(); List<ItemStack> drops = event.getDrops(); event.setDroppedExp(0); event.getDrops().clear(); Object[] damages = damage.values().toArray(); List<Integer> values = new ArrayList<Integer>(); for (int i : damage.values()) { values.add(i); } int highest = Collections.max(values); String winner = ""; for (String s : damage.keySet()) { if (damage.get(s) == highest) { winner = s; } } Player p = getServer().getPlayer(winner); for (ItemStack i : drops) { p.getInventory().addItem(i); } p.getInventory().addItem(new ItemStack(Material.DRAGON_EGG)); p.giveExp(exp); p.sendMessage(ChatColor.GREEN + "I see you did most of the work, here's your reward :3"); damage.clear(); } } }
I have just created a plugin for this, it does not yet have much customisation, only the prefix at this point, but I will add to it over time.
Wait so just like a message to who got last hit on the boss and killed it? Boss meaning Ender Dragon?
Boss meaning boss. Whomever hit it last on a boss gets his/her name announced over the server, so there is no conflict and confusion among the others who claim they got the last hit. Pheonix actually started this idea as "BDAnnouncer" and has potential.
[quote uid=90643426 name="TheLazeboy" post=1858097]Boss meaning boss. Whomever hit it last on a boss gets his/her name announced over the server, so there is no conflict and confusion among the others who claim they got the last hit. Pheonix actually started this idea as "BDAnnouncer" and has potential.[/quote] I could make this if you want? So you just want the server to announce the person who got the last hit on the ender dragon and killed it right? Do they get a reward or no? [quote uid=90643426 name="TheLazeboy" post=1858097]Boss meaning boss. Whomever hit it last on a boss gets his/her name announced over the server, so there is no conflict and confusion among the others who claim they got the last hit. Pheonix actually started this idea as "BDAnnouncer" and has potential.[/quote] Finished! Just waiting to test it for you! [quote uid=90643426 name="TheLazeboy" post=1847310]Let me set the scene.... A group of players on a server are fighting rigorously to kill the dragon with the last hit. Moments later, the dragon is a mere hit away from death. Some archers shoot a well-aimed shot towards the dragon; meanwhile, some foot soldiers are striking their beefed, enchanted diamonds swords. The sound of victory is played through everyone's headset. And then... it happens. "I did it I killed the dragon!" "bro i got him, you lagged" "Hey my arrow dealt the damage idiots." ... Yeah. The ever unproven bragging right. Until this plugin comes along and shows who killed the dragon (or wither). Perhaps when any dragon or wither is killed on the server, the plugin announces the person who got the last hit. And maybe a list of the players who dealt the most damage and how much damage they dealt. I seriously hope this plugin request is accepted and made by coder(s), on behalf of all Minecraft server players.[/quote] This tells you who the person was who killed the bosses the Wither and Ender Dragon. This should suit your needs: <Edit by Moderator: Redacted mediafire url> EDIT by Moderator: merged posts, please use the edit button instead of double posting.
TheLazeboy That was the most entertaining plugin request I have ever read! On another note... Who gets the dragon egg? Maybe cancel the spawning of it and give it to the player who kills/does the most damage to the dragon? To avoid more confusion and unfairness...
Almost done with adding percentage of damage they did too! EDIT: Added percentage of damage they do and made it broadcast once boss is killed! Uploading soon! TheLazeboy