Getting all blocks directly under player

Discussion in 'Plugin Development' started by Quantum64, May 25, 2014.

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

    Quantum64

    player.getLocation().getBlock().getRelative(BlockFace.DOWN) returns a single block directly under the player, but if the player was standing in between two blocks and this was used to remove a block, the player would still be left standing on one block. I am looking for a way to get all the blocks supporting a player from falling. Any help would be appreciated :D
     
  2. Offline

    rfsantos1996

    Maybe get a region (3x3 with the player block on the middle?)
     
  3. Offline

    Niknea

    Quantum64 Get the players location, then run a loop finding each block under them (you can do this by just subtracting 1 to the y coordinate) until you get to where you want.
     
Thread Status:
Not open for further replies.

Share This Page