-
Notifications
You must be signed in to change notification settings - Fork 0
Adding a Disc
Let's assume that your addon is called disco-example
and the id of your new disc is new_disc
. Replace these with the actual ones in the following steps.
A full example can be found in the example directory.
- Convert your audio to a
.ogg
file with one channel (mono) - Place the file at
assets/disco-example/sounds/new_disc.ogg
Add the following line to the fabric.mod.json
file at the root of your project. If this file doesn't already exist, create it with the following contents contents:
The
duration
is the length of the audio in seconds.
{
"schemaVersion": 1,
"id": "disco-example",
"version": "1.0.0",
"name": "Disco Example",
"description": "Example Disco addon",
"custom": {
"disco": {
"discs": [
+ { "id": "new_disc", "duration": 123 }
]
}
}
}
Add the following lines to assets/disco-example/sounds.json
:
{
+ "new_disc": {
+ "category": "record",
+ "sounds": [{ "name": "disco-example:new_disc", "stream": true }]
+ }
}
Place your sprite at assets/disco-example/textures/item/new_disc.png
. It can be 16x16, but any size will work.
Create assets/disco-example/models/item/new_disc.json
with the following contents:
{
"parent": "item/generated",
"textures": {
"layer0": "disco-example:item/new_disc"
}
}
Add the following line to assets/disco-example/lang/en_us.json
:
{
+ "item.disco-example.new_disc.desc": "Artist - New Disc"
}
Make sure to add this to any other languages your addon supports
Add an entry like shown data/disco-example/tags/items/discs.json
:
{
"values": [
+ { "id": "disco-example:new_disc", "required": false }
]
}
And finally, ensure that data/minecraft/tags/items/music_discs.json
has the following contents:
{
"values": [
{ "id": "#disco-example:discs", "required": false }
]
}
The last step is to compress these files and directories into a .jar
file. You can use the following command to do so:
cd /path/to/addon/root
jar cvf disco-example.jar .
If you compress it another way, make sure that you create a META-INF/MANIFEST.MF
beforehand with at least the following contents:
Manifest-Version: 1.0