To add a crafting recipe with NBT data in a Fabric mod, you can use the FabricJsonRecipeSerializer class. Here is an example of how to do it:
- First, define your new item in your
mod.json file:
"mixins": [
"yourmod.mixins.json"
],
"client": [
"yourmod.client.json"
],
"server": [
"yourmod.server.json"
],
"items": {
"youritem": {
"category": "misc",
"ingredients": [
{
"item": "minecraft:diamond"
}
],
"result": {
"item": "yourmod:youritem",
"count": 1,
"nbt": "{YourNBTData}"
},
"group": "yourgroup",
"count": 1
}
}
- In your
mod.json file, add the following to the mixins section:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a new method for your item:
{
"namespace": "yourmod",
"mixins": [
"yourmod.methods.json"
]
}
- In your
yourmod.methods.json file, add the following to define a