BetaNyan I think you'd make a cuboid-like check method. Get top-left and bottom-right locations, and check if the location is inside those two. Just like that, cubic .distance checks!
I don't like getting "spoon-fead", or spoon-feading others just like the next guy, but how would I even attempt that? I can get the block, how do I get the blocks around it?
BetaNyan You can create two vectors (points in this case) that you want to define as a rectangle, then use isInAABB(Vector, Vector) on them (the actual name escapes me right now, but it's something like that) on the Vector that is the location you're at.
BetaNyan Personally, I don't care about spoon-feeding. If someone doesn't get it, wouldn't it be faster to just show them? Anyways, back on topic: Code:java Location original = <ORIGINAL LOCATION>;Location topLeft = original.clone().add(10, 5, 10);Location bottomRight = original.clone().subtract(10, 0, 10) That code will give you three locations, all properly named. Then, to check if a location is inside: Code:java Location in = <INPUT LOCATION>; boolean checkX = in.getX() < topLeft.getX() && in.getX() > bottomRight.getX()boolean checkY = in.getY() < topLeft.getY() && in.getY() > bottomRight.getY()boolean checkZ = in.getZ() < topLeft.getZ() && in.getZ() > bottomRight.getZ() boolean inside = checkX && checkY && checkZ;
for (int x=player.getLocation().getX()-(distance/2); x<=player.getLocation().getX()+(distance/2); x++) {for (int y=player.getLocation().getY()-(distance/2); y<=player.getLocation().getY()+(distance/2); y++) {for (int z=player.getLocation().getZ()-(distance/2); z<=player.getLocation().getZ()+(distance/2); z++) { if (new Location(player.getLocation().getWorld(), x, y, z).getBlock().getType() == Material.STONE) { //stone found within distance } } } }