Shaped Recipe Section - ShaneBeee/SkBee GitHub Wiki

Registering a shaped recipe has never been so easy.
You may be wondering "why should I use this over the recipe effect?"
Simple answer is it makes your code much more readable, and helps understand errors a lot easier than dealing with everything in one extremely long line.

Typically you will want to put these recipes sections in an on load or on skript load event.

Format:

register shaped recipe:
	id: <String>
	result: <ItemStack>
	shape: <Strings>
	group: [String]
	category: [String]
	ingredients: 
		<Section>

ID:

REQUIRED
The ID for your recipe. This is used for recipe discovery and Minecraft's /recipe command.
This needs to follow Minecraft's namespace:key format.
Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens.
Namespaces are optional, if left out it will default to the namespace in the SkBee config.
Keys may only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes.

Example:

id: "custom:my_fancy_recipe"

Result:

REQUIRED
The resulting item of this recipe. Global variables are accepted here.

Example:

result: diamond sword of unbreaking 3 named "Mr Swordy Sword Sword"

Shape:

REQUIRED
A list of strings (1 to 3 strings) which each have 1-3 characters (must be the same char count per string).
These correspond to the ingredients set for these shapes.
Some examples of valid strings:

"aaa", "bbb", "ccc"
" a ", " b ", " c "
"aa", "bb"

Some examples of invalid strings:

"aaa", "bb", "ccc" (all must have the same character count)
"aaaa" (only 1 to 3 characters are allowed)

Group:

OPTIONAL
Define a group to group your recipes together in the recipe book.
(an example would be having 3 recipes with the same outcome but a variety of ingredients).

Examples:

group: "my_custom_stuff"

Category:

OPTIONAL
The recipe book category your recipe will be in (optional) [Requires MC 1.19+].
This is the little category boxes on the left side of the recipe book GUI.
Options are "building", "redstone", "equipment", "misc".

Ingredients:

REQUIRED
This section allows you to define ingredients.
Using a simple effect you can easily create ingredients for your recipe:
set ingredient (of|for) %string% to %itemstack/materialchoice% .
The first string represents the character in your shape.
Example, if you have an "a" in your shape, you use that in your string here.
The next object will be the item to be used in the recipe. You can use an ItemStack or MaterialChoice here.

Examples:

ingredients:
    set ingredient of "a" to diamond
    set ingredient of "b" to stick

Global variables are accepted here.
Yes, you CAN spawn entities in this section. I dunno why you'd want to, ask @sovdeeth about this one

Examples:

on load:
	register shaped recipe:
		id: "custom:fancy_stone"
		result: stone named "&aFANCY STONE"
		shape: "aaa", "aba", "aaa"
		group: "bloop"
		category: "building"
		ingredients:
			set ingredient of "a" to stone
			set ingredient of "b" to diamond

	register shaped recipe:
		id: "custom:fancy_sword"
		result: diamond sword of unbreaking 5 named "&bStrong Sword"
		shape: "a", "a", "b"
		ingredients:
			set ingredient of "a" to emerald
			set ingredient of "b" to stick named "DOOM"
	
	register shaped recipe:
		id: "custom:string"
		result: 4 of string
		shape: "a"
		ingredients:
			set ingredient of "a" to material choice of all wool

	register shaped recipe:
		id: "custom:bee_2"
		result: (skull of "MHF_Bee" parsed as offline player) named "&bMr &3Bee"
		shape: "x x", " z ", "x x"
		ingredients:
			set ingredient of "x" to honeycomb
			set ingredient of "z" to honey bottle
⚠️ **GitHub.com Fallback** ⚠️