Package org.bukkit.block
Interface Jukebox
-
- All Superinterfaces:
BlockState
,Metadatable
public interface Jukebox extends BlockState
Represents a captured state of a jukebox.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
eject()
Stops the jukebox playing and ejects the current record.Material
getPlaying()
Gets the record being played.boolean
isPlaying()
Checks if the jukebox is playing a record.void
setPlaying(Material record)
Sets the record being played.-
Methods inherited from interface org.bukkit.block.BlockState
getBlock, getBlockData, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isPlaced, setBlockData, setData, setRawData, setType, update, update, update
-
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
-
-
-
-
Method Detail
-
getPlaying
Material getPlaying()
Gets the record being played.- Returns:
- The record Material, or AIR if none is playing
-
setPlaying
void setPlaying(Material record)
Sets the record being played.- Parameters:
record
- The record Material, or null/AIR to stop playing
-
isPlaying
boolean isPlaying()
Checks if the jukebox is playing a record.- Returns:
- True if there is a record playing
-
eject
boolean eject()
Stops the jukebox playing and ejects the current record.If the block represented by this state is no longer a jukebox, this will do nothing and return false.
- Returns:
- True if a record was ejected; false if there was none playing
- Throws:
IllegalStateException
- if this block state is not placed
-
-