Solved NO NEED TO CLICK HERE ITS SOLVED

Discussion in 'Plugin Development' started by MoeMix, Feb 8, 2014.

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

    MoeMix

    I am trying to setup a killstreak however I am having difficulties adding one to the streak with every kill. Can anyone see what is wrong with my code?
    Code:java
    1. public static HashMap<String, Integer> kills = new HashMap<String, Integer>();
    2.  
    3. public void onkill(EntityDeathEvent e){
    4. if(e.getEntity().getKiller() instanceof Player){
    5. Player killer = e.getEntity().getKiller();
    6. if(!kills.containsKey(killer.getName())){
    7. kills.put(killer.getName(), 1);
    8. }
    9. else if(kills.containsKey(killer.getName())){
    10. kills.put(killer.getName(), kills.get(killer.getName()) + 1);
    11. killer.sendMessage("you now have " + kills.get(killer.getName()));
    12. }
    13. }
    14.  
    15. }
     
  2. Offline

    Maurdekye

    MoeMix You might as well post your solution for future reference, in case someone has a similar problem.
     
  3. Offline

    MoeMix

    Maurdekye yeah you're right, I just forgot an @EventHandler :p the most annoying thing haha.
     
Thread Status:
Not open for further replies.

Share This Page