Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved How do I clear effects from a player?

Comments in 'Plugin Development' started by SirGamer, Nov 26, 2015.

  1. SirGamer
    Offline

    SirGamer New Member

    Joined:
    Nov 26, 2015
    Posts:
    5
    Minecraft User:
    SirGamer
    So, I'm working on ServerAuthBlindness aka SimpleAuthBlindness.

    And I've gotten the basics down, now, how would I clear the effect?

    I need to use $sender...

    Please help,

    SirGamer.
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    $player->removeAllEffects();
    would be useful.
  3. SirGamer
    Offline

    SirGamer New Member

    Joined:
    Nov 26, 2015
    Posts:
    5
    Minecraft User:
    SirGamer
    Ah, ok.

    But how would I do it with:
    Code:
    $sender
    The same way?
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    As long as $sender is a Player instance.
  5. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    Here
    Code:
    $sender->removeEffect(/*effect id*/);
  6. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    And what if they have multiple effects?
    In that case
    PHP:
    $sender->removeAllEffects();
    would be better
  7. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    but he wants to remove the blindness
  8. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    That's why I said what if.
    It doesn't hurt to give some extra help.

Share This Page

Advertisement