Solved Why do these potion effects remain at level 1?

Discussion in 'Plugin Development' started by Deleted user, Feb 11, 2014.

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

    Deleted user

    Code:
    inked.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 140, Integer.MAX_VALUE));
    inked.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 140, 9));
    inked.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 140, 4));
    Thanks,
    JHG0
     
  2. Offline

    Gater12

    JHG0 You mean the little tag this that says "Blindness II" or something? I think it only goes up to IV (4). Don't worry the amplifier has been applied.
     
  3. Offline

    Deleted user

    Gater12
    It actually hasn't -_-
     
  4. Offline

    Maurdekye

    JHG0 The number you put in counts up from 0, so putting 3 in would give a power of IV. Your power of 4 is too high; try lowering it.
     
  5. Offline

    DevRosemberg

    Maurdekye the limit i think is 120 so thats not the problem.
     
  6. Offline

    Conarnar

    DevRosemberg the limit is actually 127, but he is talking about the limit for the potion effect tag thingy that appears when you open your inventory.
     
  7. Offline

    Deleted user

    Conarnar DevRosemberg

    THe limit can be whatever, it just doesn't work -_- And I'm talking about the physical effect
     
  8. Offline

    Deleted user

  9. Offline

    SenseTheGod

    Okay... Let me help you out...
    Examples:
    player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 300, 0));
    Okay let me tell you what this says.. Right now you are giving the player.
    Speed 1 for 15 seconds..

    player.addPotionEffect //Obviously just adding the effect.
    (new PotionEffect //Making a new potion effect to add obviously.

    PotionEffectType. //Tells you the type obviously.
    SPEED //The type of effect
    300 //The time.. You do your time * 20. So 300/20 = 15
    0 //The effector, how high you want it..
    player.addPotionEffect(new PotionEffect(PotionEffectType.<type>, <time in seconds * 20>, <amount, 0 = 1, 1 = 2,>));
     
  10. Offline

    Deleted user

    SenseTheGod

    I know how that works...sorry to say but none of that answered my question at all -_-

    And I realized it will only recognize the potion if the amplifier is less than 126 or -127 (the range of shorts)
    Solved it already ^^
     
  11. Offline

    SenseTheGod

    Okay :p Just making sure :p
     
Thread Status:
Not open for further replies.

Share This Page