Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by harveycat1, May 25, 2017.
Anyone know a good way for collecting who did the most damage to a unlimited health giant zombie
Maybe you can do a map like this
In which you save for the giant is being killed the UUID of all players with the damage they are dealing (summing every time a damage is done). Finally, when the giant dies, order the second map based on who dealt the biggest damage and you are done
EDIT: Remember to remove the value for the dead giant at the end if you don't want memory leaks
that might work i basically got to make a giant that is say alive for 2minutes and check for does most damage to it
Well, then spawn the mob using the World#spawnEntity method. Start a BukkitRunnable with 2-minute delay. Add the entity you spawn inside the map and then track all the damage your players are doing in the map
Spawn that giant then run a runnable to remove it after 2 minutes .
Create a HashMap<UUID , Double>
Check damage event , if the entity (victim ) is the Giant , put the player in the map then keep sum it ,
after that you can loop thought the map and get values
Make onentiydemagenyentity Event Check if its your gigant use getDemage to know the demage and Use getDemager Check if its a Player and add him or Update his demage Value.