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

Solved Pushing a player downwards

Discussion in 'Development' started by Melonenbubi, May 22, 2020.

  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:
    535
    GitHub:
    diamond-gold
    use something like
    PHP:
    $player->setMotion(new Vector3(0,-2,0));
     
    WhoAreMe and Melonenbubi like 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.