player.getLocation() when crouching over air

Discussion in 'Plugin Development' started by ZephireNZ, Aug 17, 2013.

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

    ZephireNZ

    I'm trying to make the block the player is standing on into air when they move onto it.

    This works fine when a player is moving, however if they crouch on the edge of a block nearby, Bukkit believes that they are on top of an air block, not a solid block.

    This becomes a pain when a player can cheat the system, crouching over a gap - or even just standing on the edge - and not falling as they're supposed to.

    How would you suggest I get the block the player is crouching on, not the one they're 'on', so to speak?
     
  2. Offline

    Assist

    ZephireNZ
    Try using PlayerMoveEvent, then check if block 'to' is air, and block below the 'to' is air, and block 'from' is not air. Block 'from' would be the block they are standing on.
     
  3. Offline

    Ibas

    But.. How to get block below,from?
     
  4. Offline

    xTrollxDudex

    ZephireNZ
    player.getLocation().getBlockX()
     
  5. Offline

    tommycake50

    offtopic: why do you have a facepalm picture in your signature?
     
  6. Offline

    xTrollxDudex

    tommycake50
    Dang site sources :p! Idk. It's a mystery, don't post it out loud :p
     
    tommycake50 likes this.
Thread Status:
Not open for further replies.

Share This Page