You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**RecipesAPI** is a lightweight and easy-to-use API that allows you to create custom recipes for your Spigot server. Whether you want to add custom shaped or shapeless crafting recipes, furnace smelting recipes, or other custom item interactions, this API makes it simple to do so.
6
6
7
7
## Features
8
-
-**Create Custom Recipes**: Add shaped, shapeless, and furnace, and other type recipes with ease.
9
-
-**Advanced Recipe Handling**: Support for custom ingredients with meta data (e.g., items with custom names).
8
+
-**Create Custom Recipes**: Add shaped, shapeless, furnace, and other types of recipes with ease.
9
+
-**Advanced Recipe Handling**: Support for custom ingredients with metadata (lore, custom model data, persistent data container).
10
10
-**Easy Integration**: Simple API to integrate into any Spigot plugin.
11
-
-**Hooks**: Support ItemsAdder, Oraxen items. You can create your own hook with your customs items systems.
12
-
-**Version Compatibility**: Works with recent Spigot versions and allows you to create recipes dynamically. Folia compatibility if you use FoliaLib.
11
+
-**Plugin Hooks**: Built-in support for ItemsAdder and Oraxen items. You can create your own hook with your custom item systems.
12
+
-**Version Compatibility**: Works with recent Spigot versions and allows you to create recipes dynamically.
13
13
-**Lightweight**: No need to include large libraries or dependencies.
14
14
-**Open Source**: Available under the MIT License.
15
15
-**Javadoc**: Comprehensive documentation for easy reference.
@@ -42,10 +42,12 @@ shadowJar {
42
42
43
43
## Usage Example
44
44
45
-
Below is an example of how to use **RecipesAPI** in your Spigot plugin.
46
-
This example demonstrates adding four types of recipes: a simple shapeless crafting recipe, a shaped crafting recipe, a custom ingredient shapeless recipe, and a furnace recipe.
45
+
Below is an example of how to use **RecipesAPI** in your Spigot plugin.
46
+
This example demonstrates adding multiple types of recipes including shapeless, shaped, custom ingredients, and furnace recipes.
47
47
You can see how easy it is to create and register recipes with the API.
48
-
The exemple plugin is available in the `test-plugin` directory.
48
+
The example plugin is available in the `test-plugin` directory.
49
+
50
+
### Programmatic Recipe Creation
49
51
50
52
```java
51
53
publicfinalclassTestPluginextendsJavaPlugin {
@@ -54,19 +56,19 @@ public final class TestPlugin extends JavaPlugin {
RecipesAPI supports loading recipes from YAML files. Simply place `.yml` files in your plugin's `recipes/` folder (or any folder you configure with `RecipeLoader`).
259
+
260
+
### Recipe File Format
261
+
262
+
```yaml
263
+
type: CRAFTING_SHAPED
264
+
pattern:
265
+
- "DDD"
266
+
- "DID"
267
+
- "DDD"
268
+
ingredients:
269
+
- item: DIRT
270
+
sign: D
271
+
- item: DIAMOND
272
+
sign: I
273
+
result:
274
+
item: DIAMOND
275
+
amount: 64
276
+
group: "custom_recipes"
277
+
category: "MISC"
278
+
```
279
+
280
+
### YAML Recipe Fields
281
+
282
+
#### Required Fields
283
+
- `type` - Recipe type (see Recipe Types section)
284
+
- `ingredients`- List of ingredients (see Ingredient Types below)
285
+
- `result.item`- The resulting item
286
+
287
+
#### Optional Fields
288
+
- `result.amount` - Output amount (default: 1)
289
+
- `pattern`- Pattern for shaped recipes (max 3 rows, max 3 chars per row)
290
+
- `group`- Recipe group for the recipe book
291
+
- `category`- Recipe category (BUILDING, REDSTONE, EQUIPMENT, MISC for crafting; FOOD, BLOCKS, MISC for cooking)
292
+
- `cooking-time` - Cooking time in ticks for smelting recipes (default: 0)
293
+
- `experience` - Experience reward for smelting recipes (default: 0.0)
294
+
295
+
### Pattern Validation
296
+
297
+
For `CRAFTING_SHAPED` recipes, the pattern is validated:
298
+
- Maximum 3 rows
299
+
- Maximum 3 characters per row
300
+
- All pattern characters must have corresponding ingredients with matching signs
301
+
- Empty rows are not allowed
302
+
303
+
### Ingredient Types in YAML
304
+
- `item: MATERIAL_NAME` - Simple material
305
+
- `item: material:MATERIAL_NAME` - Explicit material
306
+
- `item: tag:TAG_NAME` - Minecraft tag
307
+
- `item: item:BASE64_STRING` or `item: base64:BASE64_STRING` - Custom item from Base64
308
+
- `item: itemsadder:ITEM_ID` - ItemsAdder item
309
+
- `item: oraxen:ITEM_ID` - Oraxen item
310
+
- `sign: X` - Character used in shaped recipe patterns (required for shaped recipes)
311
+
- `strict: true` - Require exact item match including display name (optional, default: false)
0 commit comments