public interface Jukebox extends TileState
Modifier and Type | Method and Description |
---|---|
boolean |
eject()
Stops the jukebox playing and ejects the current record.
|
@NotNull Material |
getPlaying()
Gets the record inserted into the jukebox.
|
@NotNull ItemStack |
getRecord()
Gets the record item inserted into the jukebox.
|
boolean |
isPlaying()
Checks if the jukebox is playing a record.
|
void |
setPlaying(@Nullable Material record)
Sets the record being played.
|
void |
setRecord(@Nullable ItemStack record)
Sets the record being played.
|
void |
stopPlaying()
Stops the jukebox playing without ejecting the record.
|
getPersistentDataContainer
getBlock, getBlockData, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isPlaced, setBlockData, setData, setRawData, setType, update, update, update
getMetadata, hasMetadata, removeMetadata, setMetadata
@NotNull @NotNull Material getPlaying()
void setPlaying(@Nullable @Nullable Material record)
record
- The record Material, or null/AIR to stop playing@NotNull @NotNull ItemStack getRecord()
void setRecord(@Nullable @Nullable ItemStack record)
record
- the record to insert or null/AIR to emptyboolean isPlaying()
void stopPlaying()
boolean eject()
If the block represented by this state is no longer a jukebox, this will do nothing and return false.
IllegalStateException
- if this block state is not placedCopyright © 2021. All rights reserved.