Help.

Discussion in 'Plugin Development' started by A4Papers, Mar 25, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    A4Papers

    Is there anyway of getting the the player that first hit in a death message? Something like "(player1) was killed by (player) after (player) started the fight"

    Thanks
     
  2. Offline

    unon1100

    I want you to get as much Java Experience as possible from this, so I'm not going to spoonfeed the answer to you.

    Try this - Create a HashMap (In the class part, not within the event). When a Player damages a player, record each of them in the HashMap. Now, create a check before adding them to make sure that they aren't already in the hashmap. When the player dies (PlayerDeathEvent) check to see if the last damager was a player. To do that...


    Also, this should help you a bit http://jd.bukkit.org/rb/apidocs/org/bukkit/event/entity/PlayerDeathEvent.html

    Now that you have all of this, try to use your programming skills. You should have a method that keeps track of the first person who hurt them, a method to see who killed them, and now just put it together and set the death messages!
     
Thread Status:
Not open for further replies.

Share This Page