How do I check if player is collided vertically?

Discussion in 'Plugin Development' started by GxDD, Dec 22, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    GxDD

    When I modified vanilla client to make a hacked one, I found that there were methods isCollidedVertically() and isCollidedHorizontally(), but I can't find these in Bukkit.
    I want to make a Bukkit Minigame plugin, that makes if you are vertically(NOT horizontally) collided with any block, the player binds to it. How can I do that?

    EDIT: The player can be collided fully vertically, means it can be collided with the block above, or the block below.
     
  2. Offline

    KarimAKL

    @GxDD Not sure if this would work but have you tried checking the block above or below the player? If not try checking if it's not air and then do something.
     
  3. Offline

    MightyOne

    I think when a player is running against a wall he is exactly 0.250000 whatever away from a block. I think that's how I did once check it in the PlayerMovementEvent.
     
Thread Status:
Not open for further replies.

Share This Page