Solved Pushing a player downwards

Discussion in 'Development' started by Melonenbubi, May 22, 2020 at 4:25 PM.

  1. Melonenbubi

    Melonenbubi Spider

    Messages:
    13
    Hello,

    using the $player->knockback() function a player can be knocked into a direction with a specific power. But is it possible to knock a player down as well (e.g. the player has jumps from a high place and you want to "knock him down" - like an acceleration of the player movement - just downwards)?
     
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    435
    use something like
    PHP:
    $player->setMotion(new Vector3(0,-2,0));
     
    WhoAreMe and Melonenbubi like this.

Share This Page

  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.