PotionEffectType

Discussion in 'Plugin Development' started by bumppy5, Sep 30, 2014.

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

    bumppy5

    Code:
        @EventHandler
        public void onInteract(PlayerInteractEvent event)
        {
            Player player = event.getPlayer();
            if(event.getPlayer().getItemInHand().getType() == Material.FEATHER)
            {
                if(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)
                {
                    player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 30, 7));
                }
            }
        }
    I am having a problem with the duration of the speed. I set it to 30 but it only seems to last a couple of seconds. I cannot tell why this is happening.
     
  2. Offline

    Skionz

    Its asking for a time in ticks. 30 ticks == 1.5 seconds
     
  3. Offline

    RingOfStorms

Thread Status:
Not open for further replies.

Share This Page