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

Entity slowness

Discussion in 'Development' started by Hipster, Aug 16, 2020.

  1. Hipster

    Hipster Zombie

    Messages:
    214
    I cannot find the code for how pocketmine changes speed of the player when player collides with cobweb/lava. Can someone link it to me?
     
  2. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    you could check if the player is in a cobweb by using PlayerMoveEvent. When they are stuck in a cobweb, adding speed to them should do what you want.
     
  3. Hipster

    Hipster Zombie

    Messages:
    214
    yea but where is pocketmine handling the slowness?
     
  4. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    bruh please read the thread, then think, then send posts, thankh you, he said he want to know how pmmp change speed of player in lava & water
     
  5. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    idk that, but iknow how change the speed of player with (Slowness effect)
    PHP:
    case Effect::SLOWNESS:
       
    $attr $entity->getAttributeMap()->getAttribute(Attribute::MOVEMENT_SPEED);
       
    $attr->setValue($attr->getValue() * (0.15 $instance->getEffectLevel()), true);
       break;
     
  6. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    You know both ways work right
     
    GodWeedZao likes this.
  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.