Skip to content

Creating Content ‐ Recipes

Flan edited this page Apr 8, 2024 · 2 revisions

Recipes in Flan's Mod: Reloaded

Recipes in Flan's Mod: Reloaded use .json files, with the same format as Minecraft. There is no mirror Definition .asset in the Unity editor, you simply write the JSON either way, whether you are working in Unity or directly in JSON.

Recipe Types

Recipe Type - Gun Fabrication

For now, an example .json:

{
  "type": "flansmod:gun_fabrication",
  "category": "equipment",
  "ingredients": [
	{
		"type": "flansmod:tiered_part",
		"materials": [ "Metal", "Composite" ],
		"tag": "flansmod:upper_receiver",
		"min": 3,
		"max": 99
	},
	{
		"type": "flansmod:tiered_part",
		"materials": [ "Metal", "Composite" ],
		"tag": "flansmod:lower_receiver",
		"min": 3,
		"max": 99
	},
	{
		"type": "flansmod:tiered_part",
		"materials": [ "Metal", "Composite" ],
		"tag": "flansmod:barrel",
		"min": 3,
		"max": 99
	},
	{
		"type": "flansmod:tiered_part",
		"materials": [ "Wood" ],
		"tag": "flansmod:stock",
		"min": 3,
		"max": 99
	},
	{
		"type": "flansmod:tiered_part",
		"materials": [ "Wood" ],
		"tag": "flansmod:grip",
		"min": 3,
		"max": 99
	}
  ],
  "result": {
    "item": "flansvendersgame:fc_far"
  },
  "craft_time": 300,
  "show_notification": true
}

Recipe Type - Part Fabrication

For now, an example:

{
  "type": "flansmod:part_fabrication",
  "category": "equipment",
  "ingredients": [
	{
		"type": "flansmod:tiered_material",
		"material": "flansbasicparts:steel",
		"count": 45
	},
	{
		"type": "flansmod:stacked_vanilla",
		"items": 
		[ 
			"minecraft:diamond" 
		],
		"count": 3
	}
  ],
  "result": {
    "item": "flansvendersgame:fc_diamond_sights"
  },
  "craft_time": 300,
  "show_notification": true
}

Ingredient Types

Because the default Minecraft ingredient types are more about matching stacks or tags, and can only consume one of each stack, we've got some custom ingredient types. Technically you can include them in vanilla recipes, like the crafting table or furnace, but they will either match for 1 of that item, or not at all. It's not supported behaviour anyway...

Both these custom types go in the ingredients array of a Gun Fabrication recipe or Part Fabrication recipe.

When working with Materials, make sure you know what the "count" actually means.
Some materials, like iron in Basic Parts, set 1=nugget, 9=ingot, 81=block.
Some materials, like fiberglass in Basic Parts, are instead configured so that the smallest possible division is actually 9. This is sometimes done to make the numbers match up between different material types. Ultimately, these are design decisions for whoever defined the materials.

Ingredient Type - Tiered Material

This one references a Materials, and specifies an amount of that material to match.

{
	"type": "flansmod:tiered_material",
	"material": "flansbasicparts:steel",
	"count": 45
}

Ingredient Type - Stacked Vanilla

This ingredient is for when you want to take in N of an item, where N > 1. Minecraft can only consume 1 of inputs by default.

{
	"type": "flansmod:stacked_vanilla",
	"items": 
	[ 
		"minecraft:diamond" 
	],
	"count": 3
}

Ingredient Type - Tiered Part

This is for Gun Fabricator only, and will match a broad range of inputs across all installed Content Packs. It specifies a set of parameters for acceptable Materials, and the gun can be made from Parts from any pack so long as their Material matches the parameters.
min and max: What tiers of Material are allowed? Generally if you don't care about an upper limit, set max to 99.
materials: This is a list of MaterialTypes, not Material IDs!
tag: Any item tag, make sure you tag the items to match. Also, general all-purpose tags can be defined in the flansmod namespace. Even though flansmod itself contains no parts and no guns, Basic Parts tags its parts and Vender's Game tags its recipes in flansmod.

{
	"type": "flansmod:tiered_part",
	"materials": [ "Metal", "Composite" ],
	"tag": "flansmod:lower_receiver",
	"min": 2,
	"max": 99
}

Clone this wiki locally