The Flattening is a very simple NeoForge/Fabric Architectury mod that allows datapacks (and other mods) to easily add in-world anvil flattening recipes.
Video, because it's hard to explain:
Recipe JSON Examples
Block Flattening:
{
"type":"the_flattening:flattening",
"input":{
"id":"minecraft:copper_block"
},
"output":{
"id":"minecraft:copper_trapdoor",
"count":12
}
}
Block Flattening Schema:
type: "the_flattening:flattening" [required as shown]
input: {
id: [Item ID String, must refer to a block, required]
}
output: {
id: [Item ID String, required]
count: [Integer, Optional, defaults to 1]
}
Entity Flattening [1.0.1+]:
{
"type":"the_flattening:entity_flattening",
"input":"minecraft:cow",
"output":{
"id":"minecraft:milk_bucket"
},
"shouldDropEntityLoot": true,
"shouldDropXp": true
}
Entity Flattening Schema [1.0.1+]:
type: "the_flattening:entity_flattening" [required as shown]
input: [Entity Type ID String, required]
output: {
id: [Item ID String, required]
count: [Integer, Optional, defaults to 1]
}
shouldDropEntityLoot: [Boolean, Optional, defaults to false]
shouldDropXp: [Boolean, Optional, defaults to false]