Interface Jukebox

All Superinterfaces:
BlockState, Metadatable, PersistentDataHolder, TileState

public interface Jukebox extends TileState
Represents a captured state of a jukebox.
  • Method Details

    • getPlaying

      @NotNull @NotNull Material getPlaying()
      Gets the record inserted into the jukebox.
      The record Material, or AIR if none is inserted
    • setPlaying

      void setPlaying(@Nullable @Nullable Material record)
      Sets the record being played.
      record - The record Material, or null/AIR to stop playing
    • getRecord

      Gets the record item inserted into the jukebox.
      a copy of the inserted record, or an air stack if none
    • setRecord

      void setRecord(@Nullable @Nullable ItemStack record)
      Sets the record being played.
      record - the record to insert or null/AIR to empty
    • isPlaying

      boolean isPlaying()
      Checks if the jukebox is playing a record.
      True if there is a record playing
    • stopPlaying

      void stopPlaying()
      Stops the jukebox playing without ejecting the record.
    • 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.

      True if a record was ejected; false if there was none playing
      IllegalStateException - if this block state is not placed