Package org.bukkit.block
Interface Jukebox
- All Superinterfaces:
- BlockState,- Metadatable,- PersistentDataHolder,- TileState
Represents a captured state of a jukebox.
- 
Method SummaryModifier and TypeMethodDescriptionbooleaneject()Stops the jukebox playing and ejects the current record.Gets the record inserted into the jukebox.Gets the record item inserted into the jukebox.booleanChecks if the jukebox is playing a record.voidsetPlaying(@Nullable Material record) Sets the record being played.voidSets the record being played.voidStops the jukebox playing without ejecting the record.Methods inherited from interface org.bukkit.block.BlockStategetBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isCollidable, isPlaced, setBlockData, setData, setRawData, setType, update, update, updateMethods inherited from interface org.bukkit.metadata.MetadatablegetMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.block.TileStategetPersistentDataContainer, isSnapshot
- 
Method Details- 
getPlayingGets the record inserted into the jukebox.- Returns:
- The record Material, or AIR if none is inserted
 
- 
setPlayingSets the record being played.- Parameters:
- record- The record Material, or null/AIR to stop playing
 
- 
getRecordGets the record item inserted into the jukebox.- Returns:
- a copy of the inserted record, or an air stack if none
 
- 
setRecordSets the record being played.- Parameters:
- record- the record to insert or null/AIR to empty
 
- 
isPlayingboolean isPlaying()Checks if the jukebox is playing a record.- Returns:
- True if there is a record playing
 
- 
stopPlayingvoid stopPlaying()Stops the jukebox playing without ejecting the record.
- 
ejectboolean 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
 
 
-