1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved How to give player effect and if it dies. the effect will not reset

Discussion in 'Development' started by AmlxP Modz, May 22, 2020.

  1. AmlxP Modz

    AmlxP Modz Creeper

    Messages:
    3
    GitHub:
    amlxp
  2. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    reapply the effect again
     
  3. aminozomty

    aminozomty Silverfish

    Messages:
    19
    GitHub:
    aminozomty
    you can use that it will help you
    PHP:
    public function onRespawn(PlayerRespawnEvent $event){
       
    $player $event->getPlayer();
       
    $effect Effect::getEffect(8);  //Effect::getEffect(effect id);
       
    $player->addEffect(new EffectInstance($effect9991)); 
    }
     
    Howtodoit likes this.
  4. AmlxP Modz

    AmlxP Modz Creeper

    Messages:
    3
    GitHub:
    amlxp
    more simply, remove this code every time respawn $player->removeAllEffects(); but has risks
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.