How to get lowest block at position?

Discussion in 'Plugin Development' started by KingDragonRider, Oct 25, 2014.

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

    KingDragonRider

    Hi all,

    I'd like to know if there's a method in Bukkit to find the lowest block at a given location, much like how world.getHighestBlockAt(Location) gets the highest block. If not, is there another way to find it?

    Thanks,
    KingD.

    Thanks for the quick reply, teej107 (EDIT: Whoops :rolleyes:)

    I wasn't thinking straight when I wrote this; I meant to ask how to find the closest block below a location. I'm guessing I would use a for loop like you mentioned but I can imagine that taking a lot of processing power every time a player moves to a new block.

    Is there a way to do this using Bukkit methods which already exist?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Aug 25, 2018
  2. Offline

    teej107

    KingDragonRider No Bukkit methods that I know of. Looping through the blocks and checking their type won't be processor intensive. My name is teej107 btw xD

    KingDragonRider Yes. It's called the Y value at 0. And I guarantee it'll be bedrock.

    EDIT: If not, a simple for-loop looping through the Y values at the same X and Z coordinates would work.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Aug 25, 2018
    KingDragonRider likes this.
Thread Status:
Not open for further replies.

Share This Page