Removing Specific Effects

Discussion in 'Plugin Development' started by Kilovice, Dec 6, 2014.

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

    Kilovice

    I am attempting to remove certain potion effects from what effects the player currently has:
    Code:java
    1. for(PotionEffect e : player.getActivePotionEffects()){
    2. if(e.getType() == PotionEffectType.POISON){
    3. player.removePotionEffect(e.getType());
    4. }
    5. }

    This works server-side, according to the server, it doesn't have that effect, but according to the client it does and, in this case, the client overrides and the potion effect is kept. Any ideas?
     
  2. Offline

    fireblast709

    Kilovice Why not just use
    Code:java
    1. player.removePotionEffect(PotionEffectType.POISON);
     
    teej107 likes this.
  3. Offline

    MoeMix

    lol
     
    teej107 likes this.
  4. Offline

    Kilovice

    Correct me if I'm wrong, but I'm 99% sure that it only removes server-side and the client still has the potion effect
     
  5. Offline

    billywhiteMC


    Nope this works client-side as far as I'm aware.
     
  6. Offline

    fireblast709

    It's a simplified version of your code. When using the API, it's both removed client-side and server-side.
     
  7. Offline

    Kilovice

    fireblast709 Are you sure? Because when I tested it, when the player had poison and this method was called it didn't remove any effects at all
     
  8. Offline

    fireblast709

Thread Status:
Not open for further replies.

Share This Page