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

setModifier() does not work ?

Discussion in 'Plugin Help' started by BayAlper10, Apr 19, 2019.

  1. BayAlper10

    BayAlper10 Silverfish

    Messages:
    17
    GitHub:
    BayAlper10
    I use setModifier() function but does not work. whyy ?
     
  2. BayAlper10

    BayAlper10 Silverfish

    Messages:
    17
    GitHub:
    BayAlper10
    public function onDamage(EntityDamageEvent $e){
    if($e instanceof EntityDamageByChildEvent){
    $child = $e->getChild();
    if($child instanceof SnowBall){
    $e->setModifier(3);
    }
    if($child instanceof Egg){
    $e->setModifier(4);
    }
    if($child->y - $e->getEntity()->y > 1.35){
    $e->setModifier(10);
    }
    }
     
  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.