#How to make an item that, once you right click on a block, it replaces any adjacent air blocks

1 messages · Page 1 of 1 (latest)

viral trench
#

define how adjacent is "adjacent". faces only? faces and edges? faces and edges and corners?

#

use an enhanced for loop to iterate over Direction.values()
use BlockPos#offset(Direction) to get the block pos that is offset 1 block in the given Direction
use World#getBlockState(BlockPos) and BlockState#isOf(Block) to check if its air
use World#setBlockState(BlockState) to set the block at that position

eternal osprey
#

nvm