- All Superinterfaces:
public interface Jukebox extends TileState, BlockInventoryHolder
Represents a captured state of a jukebox.
Method SummaryModifier and TypeMethodDescription
eject()Stops the jukebox playing and ejects the current record.Get the object's inventory.Gets the record inserted into the jukebox.Gets the record item inserted into the jukebox.
booleanGets whether or not this jukebox has a record.
booleanChecks if the jukebox is playing a record.
(Material record)Sets the record being played.
voidSets the record being played.
booleanStarts the jukebox playing if there is a record.
voidStops the jukebox playing without ejecting the record.
Methods inherited from interface org.bukkit.inventory.BlockInventoryHolder
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
Methods inherited from interface org.bukkit.block.TileState
getPlayingGets the record inserted into the jukebox.
- The record Material, or AIR if none is inserted
setPlayingSets the record being played.
record- The record Material, or null/AIR to stop playing
hasRecordboolean hasRecord()Gets whether or not this jukebox has a record.
A jukebox can have a record but not
be playingif it was stopped with
stopPlaying()or if a record has finished playing.
- true if this jukebox has a record, false if it the jukebox is empty
getRecordGets the record item inserted into the jukebox.
- a copy of the inserted record, or an air stack if none
setRecordSets the record being played. The jukebox will start playing automatically.
record- the record to insert or null/AIR to empty
isPlayingboolean isPlaying()Checks if the jukebox is playing a record.
- True if there is a record playing
startPlayingboolean startPlaying()Starts the jukebox playing if there is a record.
- true if the jukebox had a record and was able to start playing, false if the jukebox was already playing or did not have a record
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.
- True if a record was ejected; false if there was none playing
IllegalStateException- if this block state is not placed
getInventory@NotNull JukeboxInventory getInventory()Description copied from interface:
InventoryHolderGet the object's inventory.
- Specified by:
- See Also:
getSnapshotInventory@NotNull JukeboxInventory getSnapshotInventory()
- snapshot inventory
- See Also: