PotionEffect

Discussion in 'Plugin Development' started by CraftBang, Nov 7, 2013.

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

    CraftBang

    Hey there, I'm trying to create Strength 3... but it's not really looking like strength 3.
    Code:
            player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 800 , 3), true);
    
    If I add it somewhere, and I open my inventory I only see "Strength" not Strength 3.
    Somebody knows why?
     
  2. Offline

    Noxyro

    I think this happens when you take a higher number than 2 because "normal" PotionEffect strength only goes up to 2. Just add some debug informations in an EntityDamageByEntityEvent and look if you deal more damage.
     
  3. Offline

    w00tmast3r

    You are actually giving the player strength 4. Use an amplifier of 2 to get strength 3.
     
  4. Offline

    CraftBang

    Noxyro and w00tmast3r thanks, so is it possible to manipulate that potion effect showing up ?
     
  5. Offline

    Noxyro

    http://jd.bukkit.org/rb/doxygen/d4/da7/classorg_1_1bukkit_1_1potion_1_1PotionEffect.html



    I don't know if ambient is the option you're looking for - i never used it.
    Just test it out and tell me if it is working ^^
     
  6. Offline

    CraftBang

    Noxyro it's a boolean ?
    That can be true or false, I don't think I can make a text there, I can only do true or false so that's not going to work I guess..

    But thanks for the response (I tried it can only put true of false :p )
     
  7. Offline

    Noxyro

    Oh, i missunderstood what you mean with "showing up" :p
    I thought you want to turn off the effect.

    I dont think you can change the visual effect that goes along with the PotionEffect, but if you manage to turn off the visible effect of the Potion you can instead play a custom effect at the players position with player.playEffect(EntityEffect entEffect)
     
  8. Offline

    CraftBang

    Noxyro I mean if you open your inventory you see your potions and how long they are (and they are counting down you drink them :p)
    So I drink potion, when I open my inv I see "Strength" 0:40 (and counting down)
    But I want there to be "Strength 5 "
     
  9. Offline

    Noxyro


    Im not sure, but i think this is client side... never saw something that could change the name of the PotionEffect.
    When it is possible somehow, then with packets i think.
     
Thread Status:
Not open for further replies.

Share This Page