Solved Killing mobs

Discussion in 'Bukkit Help' started by Nathan674329, Dec 28, 2016.

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

    Nathan674329

    Does anyone know how i can make it so once you hit 30 mobs, it will do something. I want to know how to do this in code. Thanks.
     
  2. Offline

    Zombie_Striker

    @Nathan674329
    1. Create a hashmap. The keys will be UUIDs and the value will be an Integer. this represents the amount of mobs a player kills.
    2. When a player kills a mob:
    3. if the player's uuid is not in the hashmap, put the players uuid with '1' as the value. This represents his first kill
    4. If they are in the hashmap, instead of putting just 1, put the existing value from the hashmap plus 1. This just adds +1 to the players kills
    5. If the kills%30==29 (or, every 30 kills), do stuff.
     
  3. Offline

    Nathan674329

Thread Status:
Not open for further replies.

Share This Page