Skip to content

These docs were made completely by AI, so they might be right, or wrong, you'll need to test them yourself. This was made for a easier understanding of everything. So use at your own risk. If anything is wrong, please don't hurt to make a PR on the page you have a problem with. ON GITHUB

Music Discs

Music discs are handled by RecordingItem and work with jukebox tiles (RecordPlayerTile) to play music.

Files: Minecraft.World/RecordingItem.h, Minecraft.World/RecordingItem.cpp

Each RecordingItem stores a recording string (like "13", "cat", "blocks") that identifies the track. All discs share these properties:

PropertyValue
Stack Size1
Rarityrare
Texture Patternrecord_ + recording name
RecordingItem::RecordingItem(int id, const wstring& recording) : Item(id), recording(recording)
{
this->maxStackSize = 1;
}

The recording field is a const std::wstring and is public (4J changed it from protected in the Java source because they needed to access it from outside the class).

When you use a disc on a jukebox tile (Tile::recordPlayer), the useOn method does the following:

  1. Checks that the target tile is a jukebox with data value 0 (meaning no disc is currently inserted)
  2. Calls RecordPlayerTile::setRecord() to insert the disc, passing the item ID
  3. Fires LevelEvent::SOUND_PLAY_RECORDING with the item ID as the data parameter
  4. Decreases the item stack count
  5. Awards the musicToMyEars statistic through GenericStats

The disc only gets inserted on the server side (level->isClientSide check). The bTestUseOnOnly parameter (a 4J addition) lets the UI check whether the interaction would work without actually doing it, which is how tooltip display works.

The appendHoverText method formats the artist and track name as "C418 - <recording>" with the rare rarity color applied through HTML formatting. The color comes from getRarity(), which always returns Rarity::rare:

eMinecraftColour rarityColour = getRarity(shared_ptr<ItemInstance>())->color;
int colour = app.GetHTMLColour(rarityColour);
wchar_t formatted[256];
swprintf(formatted, 256, L"<font color=\"#%08x\">%ls</font>", colour, L"C418 - ", recording.c_str());

The raw (unformatted) recording name is also pushed to the unformattedStrings vector for accessibility purposes.

IDStatic FieldRecording StringInternal IndexNotes
2256record_01"13"2000Ambient/cave sounds
2257record_02"cat"2001Upbeat synthesizer
2258record_03"blocks"2002Upbeat electronic
2259record_04"chirp"2003Retro chiptune
2260record_05"far"2004Calm ambient
2261record_06"mall"2005Mellow retro
2262record_07"mellohi"2006Slow haunting melody
2263record_09"stal"2007Jazz piano
2264record_10"strad"2008Tropical/upbeat
2265record_11"ward"2009Starts with record noise, then upbeat
2266record_12"11"2010Broken/corrupted recording
2267record_08"where are we now"2011LCE-exclusive disc

The “Internal Index” column shows the constructor argument passed to RecordingItem. This is the internal numbering, not the item ID. The item IDs in the Item.h constants (record_01_Id through record_12_Id) map to the standard 2256-2267 range.

Note the quirky naming: the static field record_08 holds the “where are we now” disc (ID 2267), while record_09 through record_12 hold “stal” through “11”. This is because the LCE-exclusive disc was added after the others and got the _08 slot, pushing the numbering out of order.

The disc with ID 2267 ("where are we now") is noted in the source as “not playable in the PC game, but is fine in ours”. This is a Legacy Console Edition exclusive music disc.

Each disc registers its own icon using the pattern record_<recording>:

void RecordingItem::registerIcons(IconRegister *iconRegister)
{
icon = iconRegister->registerIcon(L"record_" + recording);
}

So the texture files are named record_13, record_cat, record_blocks, etc.

The music disc system (RecordingItem) is the same between LCEMP and MinecraftConsoles. Same 12 disc IDs (2256-2267), same recording names, same constructor index values (2000-2011), same jukebox interaction through RecordPlayerTile, same tooltip formatting.

The LCE-exclusive disc “where are we now” (ID 2267) is present in both codebases. The quirky record_08/record_09 field naming is also the same.

MinecraftConsoles does rename JukeboxTile as a separate header (it gets its own JukeboxTile.h file), but the functionality is the same RecordPlayerTile system that LCEMP uses. The only API difference is that setTextureName is renamed to setIconName in MinecraftConsoles, but this is a codebase-wide rename, not specific to music discs.