Skip to main content
The StackedBlocksManager handles stacked blocks on islands, including getting and setting block amounts, and managing holograms.

Getting Block Amounts

getStackedBlockAmount

int getStackedBlockAmount(Block block)
int getStackedBlockAmount(Location location)
Get the block amount in a specific block or location.
block
Block
required
The block to check
location
Location
required
The location to check
return
int
The stacked block amount

getStackedBlockKey

Key getStackedBlockKey(Location location)
Get the block’s key in a specific location.
location
Location
required
The location to check
return
Key
The block key or null if not found

Setting Block Amounts

setStackedBlock

boolean setStackedBlock(Block block, int amount)
boolean setStackedBlock(Location location, Key blockKey, int amount)
Set a new amount for a specific block.
block
Block
required
The block to set the amount to
location
Location
required
The location of the block
blockKey
Key
required
The key of the block
amount
int
required
The new amount of the block
return
boolean
True on success

Removing Stacked Blocks

removeStackedBlock

int removeStackedBlock(Location location)
Remove stacked block at a specific location.
location
Location
required
The location of the stacked block
return
int
The amount of the removed block, or 1 if there were no blocks in the specified location

removeStackedBlocks

Map<Location, Integer> removeStackedBlocks(Chunk chunk)
Map<Location, Integer> removeStackedBlocks(World world, int chunkX, int chunkZ)
Remove stacked blocks at a specific chunk.
chunk
Chunk
required
The chunk to remove stacked blocks from
world
World
required
The world of the chunk
chunkX
int
required
The x-coords value of the chunk
chunkZ
int
required
The z-coords value of the chunk
return
Map<Location, Integer>
The stacked blocks in the provided chunk

Getting Stacked Blocks

getStackedBlocks

Map<Location, Integer> getStackedBlocks(Chunk chunk)
Map<Location, Integer> getStackedBlocks(World world, int chunkX, int chunkZ)
Map<Location, Integer> getStackedBlocks()
Get all the stacked blocks in a specific chunk or on the entire server.
chunk
Chunk
The chunk to get stacked blocks from
world
World
The world of the chunk
chunkX
int
The x-coords value of the chunk
chunkZ
int
The z-coords value of the chunk
return
Map<Location, Integer>
Map of locations to stacked block amounts

Managing Holograms

updateStackedBlockHologram

void updateStackedBlockHologram(Location location)
void updateStackedBlockHolograms(Chunk chunk)
Update the hologram of a stacked block or all holograms in a chunk.
location
Location
required
The location of the stacked block
chunk
Chunk
required
The chunk to update holograms in

removeStackedBlockHologram

void removeStackedBlockHologram(Location location)
void removeStackedBlockHolograms(Chunk chunk)
Remove the hologram of a stacked block or all holograms in a chunk.
location
Location
required
The location of the stacked block
chunk
Chunk
required
The chunk to remove holograms from