Music Box

Datapack Support

Music Box mod has support to create custom discs that will spawn in dungeons chests, drop from entities, drop from blocks, etc. You can create a datapack that adds any disc into the game, and make it spawn wherever you like! Be creative with datapacks that adds all that sassy Taylor Swift songs, or the new Linkin Park album and spread it around your Minecraft world!

Discord Link: DeltaBox Labs

How to make a custom music disc that spawn in dungeons:

  • create a new datapack following the official wiki tutorial
  • in the data folder, create a folder named musicbox
  • inside the musicbox folder, create one named loot_modifiers
  • in loot_modifiers create a new .json file, it can have any name with lowercase and no special characters (like darude_sandstorm_disc_from_desert_pyramid.json)

The file content should look like this:

{
"type": "musicbox:add_disc_loot",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:chests/desert_pyramid"
},
{
"chance": 0.5,
"condition": "minecraft:random_chance"
}
],
"duration": 232,
"name": "Darude - Sandstorm",
"radius": 30,
"url": "https://www.youtube.com/watch?v=y6120QOlsfU",
"variant": 28
}

It contains the conditions to spawn a custom music disc loot (in the conditions array), note that duration, name, radius and url are the default fields of a custom music disc.

Url Support

The url field only support YouTube links at the moment.

More Examples

Here is another example of custom disc loot:

This one adds a disc with a creeper texture, with a 0.01% chance of dropping from Creepers. It plays CaptainSparkles - Revenge song:

{
"type": "musicbox:add_disc_loot",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:entities/creeper"
},
{
"chance": 0.01,
"condition": "minecraft:random_chance"
}
],
"duration": 264,
"name": "CaptainSparklez - Revenge",
"radius": 30,
"url": "https://www.youtube.com/watch?v=cPJUBQd-PNM",
"variant": 38
}

This one, adds a Rick Roll disc with 30% chance of appearing in the villager weaponsmith chest:

{
"type": "musicbox:add_disc_loot",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:chests/village/village_weaponsmith"
},
{
"chance": 0.3,
"condition": "minecraft:random_chance"
}
],
"duration": 601,
"name": "Rick Astley - Never Gonna Give You Up",
"radius": 30,
"url": "https://www.youtube.com/watch?v=cvh0nX08nRw",
"variant": 40
}

And this one, adds a custom music disc playing a remix of C418 - Sweden, which has 0.0001% chance of dropping from breaking grass.

{
"type": "musicbox:add_disc_loot",
"conditions": [
{
"block": "minecraft:grass",
"condition": "minecraft:block_state_property"
},
{
"chance": 0.0001,
"condition": "minecraft:random_chance"
}
],
"duration": 316,
"name": "C418 - Sweden (Caution & Crisis Remix)",
"radius": 30,
"url": "https://www.youtube.com/watch?v=3pbvmR8n27w",
"variant": 37
}

Variants

The variant property is the texture the custom music disc will have. It can be between 1 and 40:

NameIDImage
LIGHT_BLUE1Light Blue
CYAN2Cyan
BLUE3Blue
PURPLE4Purple
MAGENTA5Magenta
RED6Red
ORANGE7Orange
YELLOW8Yellow
LIME9Lime
GREEN10Green
AMETHYST11Amethyst
DIAMOND12Diamond
EMERALD13Emerald
GLIDED14Gilded
LAVA15Lava
COOKIE16Cookie
CHORUS17Chorus
LAPIS18Lapis
ENDER_EYE19Ender Eye
ENDER_PEARL20Ender Pearl
MAGMA21Magma
OCEAN22Ocean
HONEY23Honey
PETRIFIED24Petrified
MAGMA_CREAM25Magma Cream
MELON26Melon
NAUTILUS27Nautilus
DUSTY28Dusty
HORNED29Horned
SHREK30Shrek
GOLDEN31Golden
COPPER32Copper
OXIDIZED33Oxidized
PRECIPICE34Precipice
MOSSY35Mossy
DRIPSTONE36Dripstone
MINECRAFT37Minecraft
CREEPER38Creeper
PEWDIEPIE39PewDiePie
PURPUR40Purpur