1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

how to get what player did the most damage? please help

Discussion in 'Help' started by newcoolboys, Apr 15, 2020.

  1. newcoolboys

    newcoolboys Spider

    Messages:
    12
    GitHub:
    Newcoolboys
    so i am making a bot plugin and just wanted to see how to get what player did the most damage pmmp. what would be the correct way to list who did the most damage?
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    You mean overall, in a specific time period or something different?
     
    newcoolboys likes this.
  3. newcoolboys

    newcoolboys Spider

    Messages:
    12
    GitHub:
    Newcoolboys
    yes as in overall, and when the bot dies it says who did the most damage overall.
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    You can listen for the EntityDamageByEntityEvent and use the method getFinalDamage() to get the damage dealt by the player. You just need to save it somewhere and add to it if the same player deals damage again
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.