Solved config time???

Discussion in 'Plugin Development' started by spankynutbean, Jun 1, 2013.

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

    spankynutbean

    I want it so the potion effect plays for the amount of time in the config in seconds.

    Here's my config:

    Code:
    ## time - The time that the player is the ninja (seconds)
    time: 1
    And here's the code:
    Code:
    @EventHandler
            public void onjoin(PlayerJoinEvent e){
                Player player = e.getPlayer();
                player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, (getConfig().getString("time")), 1));
            }
    But the potion effect is an error, and how do i multiply the number by 20 so it is in seconds?
     
  2. Offline

    vemacs

    Code:
    player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 20 * (getConfig().getInt("time")), 1));
    
     
  3. Offline

    spankynutbean

Thread Status:
Not open for further replies.

Share This Page