⬛Block Placer
Place blocks in any direction
Overview
The BlockPlacer class provides a utility for programmatically placing blocks in a specified direction from a given origin location.
Methods
create
createpublic static BlockPlacer create(JavaPlugin plugin, Material material)Creates a new BlockPlacer instance with the specified plugin and material.
Parameters
plugin: The JavaPlugin instance associated with the plugin.material: The material of the block to be placed.
Returns
Returns a new instance of the
BlockPlacerclass.
setDirection
setDirectionpublic BlockPlacer setDirection(Direction direction)Sets the direction in which blocks will be placed.
Parameters
direction: The direction in which blocks will be placed. Should be one of the values defined in theDirectionenum.
Returns
Returns the updated
BlockPlacerinstance.
setLength
setLengthSets the number of blocks to be placed in the specified direction.
Parameters
length: The number of blocks to be placed.
Returns
Returns the updated
BlockPlacerinstance.
setHeight
setHeightSets the height of the block column to be placed.
Parameters
height: The height of the block column.
Returns
Returns the updated
BlockPlacerinstance.
setDelayBetweenBlocks
setDelayBetweenBlocksSets the delay between placing each block in milliseconds.
Parameters
delay: The delay between placing each block in milliseconds.
Returns
Returns the updated
BlockPlacerinstance.
build
buildBuilds the block column starting from the specified origin location.
Parameters
origin: The origin location from which to start placing blocks.
Returns
This method does not return anything.
Enums
Direction
DirectionRepresents the direction in which blocks will be placed.
Example Usage
In this example, we create a BlockPlacer instance, set its properties, and build a column of blocks starting from the specified origin location.
Last updated