Displaying Multiple Cooldowns at once

Discussion in 'Plugin Development' started by mine2012craft, Jan 22, 2017.

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

    mine2012craft

    Ok, this is going to be a bit confusing (I think) so let me try to explain it well.

    What I am trying to accomplish here is showing multiple cooldowns (3 cooldowns) at once with the ActionBar message. They will all countdown until the cooldown time hits 0.

    [​IMG]

    (If you can barely see the actionbar text at the bottom is saids "Spell A CD: 4; Spell B CD 13; Spell C CD: 9")

    Now I have multiple spells I am going to be using, so I need to be able to also show those cooldowns as well.


    I know I need to create 3 methods to grab the cooldowns I am using, but I am just stuck on how to show them for that player.

    Code:

    Code:
        public static void setSpellACooldown(Player player, final HashMap<String,Long> cooldowns, long CooldownTime){
        
        }
    
        public static void setSpellBCooldown(Player player, final HashMap<String,Long> cooldowns, long CooldownTime){
        
        }
    Any ideas would be very appreciated.

    Thank you,
    WarlordWeaponry
     
    Last edited by a moderator: Jan 22, 2017
  2. Offline

    Mathias Eklund

    I'm assuming the text is dynamic so you should just need to reference the spells cooldown variable to show it.

    I might be misunderstanding your post though, if you are looking for a way to display your spells cooldown in a message then my answer should be the correct one, if not... well, please reformulate what you want help with as I didn't really understand that well.
     
  3. Offline

    MaxFireIce

    @mine2012craft
    Ok, let me try this XD. Keep in mind final variables can't be changed. Also, you only need one HashMap and from there you can use the (HashMap variable name).put( "My string", 1.65); for each cooldown. From there you can loop through the keys of the HashMap and print them in the action bar. If I am wrong, feel free to correct me ;) . I hope this helps :).

    Also, how are you decreasing the cooldowns?
     
    Last edited: Feb 15, 2017
Thread Status:
Not open for further replies.

Share This Page