Jukebox
High-level API
Device name:
jukeboxProvided by jukeboxes connected to a bus interface. Times are in ticks.
Methods
getElapsed():numberGets how long the jukebox has been playing the current song.
- Returns the time since the song started.
getSong():stringGets the song the jukebox is playing.
- Returns the name of the song, such as
minecraft:cat, if any.getSongLength():numberGets how long the song the jukebox is playing lasts.
- Returns the length of the song.
isPlaying():booleanGets whether the jukebox is playing a song.
- Returns whether a track is playing.
Mid-level API
Device name:
JUKEBXTimes are two bytes, low byte first, capped at 65535.
Methods
1 isPlayingGets whether the jukebox is playing a song.
- Returns one byte,
1 while a track is playing, 0 otherwise.2 getSongGets the song the jukebox is playing.
- Returns the name of the song, such as
minecraft:cat, if any. Read while OCDAV is set to read fully.3 getSongLengthReads how long the song the jukebox is playing lasts.
- Returns two bytes, the length of the song.
4 getElapsedReads how long the jukebox has been playing the current song.
- Returns two bytes, the time since the song started.