forked from nisovin/MagicSpells
-
Notifications
You must be signed in to change notification settings - Fork 71
Custom Recipes
JasperLorelai edited this page Nov 18, 2023
·
18 revisions
Custom recipes can be defined in the general.yml file or any spell file. The main configuration looks like this:
recipes:
randomKey:
# (Recipe configuration section)
# type:
# . . .| Option | Description |
|---|---|
type |
See Recipe types below. |
group |
A string. This can be used to group recipes in the Recipe Book. For example, all dye recipes are grouped. |
result |
Magic Item in string or configuration format. |
quantity |
Quantity of the result. |
namespace-key |
This key is a string which makes the recipe unique from all other recipes. It has to be lowercase. |
-
shaped:
| Option | Description |
|---|---|
shape |
Recipe shape is a string list. It should have 3 string elements, every 3 characters long. It's representing a 3x3 shape. Take a look below for an example. |
ingredients |
Map of the ingredients. Key-value pair, where the key is a shape character, and the value is a Recipe Choice. Unmapped characters usually represent air. |
Example:
shape:
- "I#I"
- "III"
- "III"
ingredients:
I: iron_ingot-
shapeless:
| Option | Description |
|---|---|
ingredients |
Map of the ingredients. Key-value pair, where the key is ignored, and the value is a Recipe Choice. |
type: shapeless
result: written_book
ingredients:
1: book
2: inc_sac
three: feather-
stonecutter:
| Option | Description |
|---|---|
ingredient |
Recipe Choice |
-
smithing:
| Option | Description |
|---|---|
base |
Recipe Choice |
template |
Since Beta 13, and MC 1.20. Recipe Choice |
addition |
Recipe Choice |
copyNbt |
Since Beta 13. true by default. Defines whether to copy the NBT from the base item to the result. |
- Cooking recipes - recipe
typefor these may be:blasting,campfire,furnace, orsmoking.
| Option | Description |
|---|---|
ingredient |
Recipe Choice |
experience |
Number (double) of experience points to reward. |
cooking-time |
Server ticks duration. |
Warning
Before Beta 13, a "Recipe Choice" could only be a material name.
ingredient: stickEverything below this alert is only valid since Beta 13.
Recipe Choice defines what items are allowed as ingredients for a recipe in a specific slot. It may either be Material Tags or specific Items.
You can find material tag names here.
ingredient: "tag:armor"Example of a slot that accepts any armor piece. This is the same as the singular armor material tag.
ingredient:
- "tag:helmets"
- "tag:chestplates"
- "tag:leggings"
- "tag:boots"Accepts Magic Items in string format and Magic Item in configuration format.
Example:
# May be in config format:
ingredient:
type: stick
name: "<gold>Magic Twig"
# Or string format:
ingredient: 'stick{name: "<gold>Magic Twig"}'Example of an ingredient which may be a stick named "Magic Twig", colored gold or red.
type: stonecutter
#
ingredient:
# Compact config format:
- {type: stick, name: "<gold>Magic Twig"}
# String format:
- 'stick{name: "<red>Magic Twig"}'
- ...