Package org.bukkit.block
Interface Dispenser
- All Superinterfaces:
BlockState
,ContainerBlock
,InventoryHolder
,Metadatable
public interface Dispenser extends BlockState, ContainerBlock
Represents a dispenser.
-
Method Summary
Modifier and Type Method Description boolean
dispense()
Attempts to dispense the contents of this block.BlockProjectileSource
getBlockProjectileSource()
Gets the BlockProjectileSource object for this dispenser.Methods inherited from interface org.bukkit.block.BlockState
getBlock, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getTypeId, getWorld, getX, getY, getZ, isPlaced, setData, setRawData, setType, setTypeId, update, update, update
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
-
Method Details
-
getBlockProjectileSource
BlockProjectileSource getBlockProjectileSource()Gets the BlockProjectileSource object for this dispenser.If the block is no longer a dispenser, this will return null.
- Returns:
- a BlockProjectileSource if valid, otherwise null
-
dispense
boolean dispense()Attempts to dispense the contents of this block.If the block is no longer a dispenser, this will return false.
- Returns:
- true if successful, otherwise false
-