get Relative
Gets the block at the given offsets
Return
Block at the given offsets
Parameters
mod X
X-coordinate offset
mod Y
Y-coordinate offset
mod Z
Z-coordinate offset
Gets the block at the given face
This method is equal to getRelative(face, 1)
Return
Block at the given face
Parameters
face
Face of this block to return
See also
Gets the block at the given distance of the given face
For example, the following method places water at 100,102,100; two blocks above 100,100,100.
Block block = world.getBlockAt(100, 100, 100);
Block shower = block.getRelative(BlockFace.UP, 2);
shower.setType(Material.WATER);
Content copied to clipboard
Return
Block at the given face
Parameters
face
Face of this block to return
distance
Distance to get the block at