Interface Jukebox
- All Superinterfaces:
BlockEntity
,CopyableDataHolder
,DataHolder
,DataHolder.Mutable
,DataSerializable
,Locatable
,SerializableDataHolder
,SerializableDataHolder.Mutable
,ValueContainer
Represents a jukebox, also known as a music disc player.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
Nested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolder
SerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>>, SerializableDataHolder.Mutable
-
Method Summary
Modifier and TypeMethodDescriptionvoid
eject()
Ejects the music disc item in this Jukebox into the world.void
insert
(ItemStackLike disc) Ejects the current music disc item in this Jukebox and inserts the given one.default Value.Mutable
<ItemStackSnapshot> item()
void
play()
Attempts to play the currently stored music disc according to theKeys.ITEM_STACK_SNAPSHOT
of thisJukebox
.void
stop()
Stops the currently playing music disc, if any.Methods inherited from interface org.spongepowered.api.block.entity.BlockEntity
block, canTick, copy, createArchetype, isRemoved, isTicking, locatableBlock, mirror, mirror, remove, rotate, rotate, setTicking, type
Methods inherited from interface org.spongepowered.api.data.DataHolder.Mutable
copyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undo
Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
Methods inherited from interface org.spongepowered.api.world.Locatable
blockPosition, location, serverLocation, world
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder
validateRawData
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder.Mutable
setRawData
-
Method Details
-
item
- Returns:
- A snapshot of the disc in the jukebox.
-
play
void play()Attempts to play the currently stored music disc according to theKeys.ITEM_STACK_SNAPSHOT
of thisJukebox
. -
stop
void stop()Stops the currently playing music disc, if any. -
eject
void eject()Ejects the music disc item in this Jukebox into the world. -
insert
Ejects the current music disc item in this Jukebox and inserts the given one.- Parameters:
disc
- The music disc item to insert
-