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!
Heads up!
Note: You can publish any datapack you create with this feature in Modrinth or Curseforge, if you do so, please send me on discord as well! I would love to see it!
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.
Heads up!
This may change in the future.
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:
Name | ID | Image |
---|---|---|
LIGHT_BLUE | 1 | ![]() |
CYAN | 2 | ![]() |
BLUE | 3 | ![]() |
PURPLE | 4 | ![]() |
MAGENTA | 5 | ![]() |
RED | 6 | ![]() |
ORANGE | 7 | ![]() |
YELLOW | 8 | ![]() |
LIME | 9 | ![]() |
GREEN | 10 | ![]() |
AMETHYST | 11 | ![]() |
DIAMOND | 12 | ![]() |
EMERALD | 13 | ![]() |
GLIDED | 14 | ![]() |
LAVA | 15 | ![]() |
COOKIE | 16 | ![]() |
CHORUS | 17 | ![]() |
LAPIS | 18 | ![]() |
ENDER_EYE | 19 | ![]() |
ENDER_PEARL | 20 | ![]() |
MAGMA | 21 | ![]() |
OCEAN | 22 | ![]() |
HONEY | 23 | ![]() |
PETRIFIED | 24 | ![]() |
MAGMA_CREAM | 25 | ![]() |
MELON | 26 | ![]() |
NAUTILUS | 27 | ![]() |
DUSTY | 28 | ![]() |
HORNED | 29 | ![]() |
SHREK | 30 | ![]() |
GOLDEN | 31 | ![]() |
COPPER | 32 | ![]() |
OXIDIZED | 33 | ![]() |
PRECIPICE | 34 | ![]() |
MOSSY | 35 | ![]() |
DRIPSTONE | 36 | ![]() |
MINECRAFT | 37 | ![]() |
CREEPER | 38 | ![]() |
PEWDIEPIE | 39 | ![]() |
PURPUR | 40 | ![]() |