... | ... | @@ -24,3 +24,71 @@ items: |
|
|
```
|
|
|
Every crafting station needs some basic information provided in the station config file, including the `name` option which corresponds to the GUI name. The `items` config section is used to change some of the GUI items. The `fill` item is the item used to fill remaining GUI slots around the recipe items. The `no-recipe` item is used to fill GUI recipe slots when there are no recipes. The previous config therefore displays that:\
|
|
|
![](https://i.imgur.com/nGXH8GG.png)
|
|
|
|
|
|
## Adding a station recipe
|
|
|
The first step is to create the `recipes` config section inside the station config. You then need to create a config section for your station recipe. The config section name corresponds to the recipe ID, which is only used internally in the plugin. What you put here does not really matter, just **make sure** the different recipes have different recipe IDs.
|
|
|
|
|
|
For this guide, we will be creating a recipe for the steel sword, which requires the player to be at least level 5. The recipe requires two specific player permissions, some steel ingots and vanilla wooden sticks as ingredients.
|
|
|
```
|
|
|
# Station recipes
|
|
|
recipes:
|
|
|
steel-sword: {}
|
|
|
```
|
|
|
|
|
|
The second step is setting up the recipe output. This is the MMOItem any player will obtain when using your recipe. Since we want the player to obtain 1 steel sword (which MMOItems type is `SWORD` and ID is `STEEL_SWORD`), this is how the `output` section should look like:
|
|
|
```
|
|
|
recipes:
|
|
|
steel-sword:
|
|
|
output:
|
|
|
material: SWORD
|
|
|
sword: STEEL_SWORD
|
|
|
amount: 1
|
|
|
```
|
|
|
|
|
|
Recipes may also have a crafting time which is the time in seconds players spend crafting the item. When clicking on the recipe item in the GUI, players will temporarily quit the GUI and a progress bar will be prompted using the vanilla title feature till the crafting is complete. In order to setup a **recipe crafting time**, use the following config template:
|
|
|
```
|
|
|
recipes:
|
|
|
steel-sword:
|
|
|
crafting-time: 10 # time in seconds
|
|
|
```
|
|
|
|
|
|
If you want your recipe **not** to display in the GUI if any of its conditions are not met, use the `hide-when-locked` recipe option, which you can enable using this template:
|
|
|
```
|
|
|
recipes:
|
|
|
steel-sword:
|
|
|
options:
|
|
|
hide-when-locked: true
|
|
|
```
|
|
|
|
|
|
## Setting up recipe ingredients
|
|
|
The most important part about crafting recipes is the recipe ingredients (physical items any player must have to use the recipe). Recipe ingredients are stored in a list inside the recipe config section. There are multiple types of recipe ingredients, the default ones being:
|
|
|
* items generated using MMOItems
|
|
|
* vanilla items (not generated using MI) with a custom display name
|
|
|
|
|
|
For instance, the ingredients needed to craft a silver sword are the following: 4 steel ingots (item generated using MMOItems) and 2 vanilla wooden sticks.
|
|
|
```
|
|
|
recipes:
|
|
|
steel-sword:
|
|
|
ingredients:
|
|
|
- 'mmoitem MATERIAL STEEL_INGOT 4 Steel_Ingot'
|
|
|
- 'vanilla STICK . 2 Wooden_Stick'
|
|
|
```
|
|
|
|
|
|
In order to setup an MMOItem ingredient, use `mmoitem <ITEM_TYPE> <ITEM_ID> (amount) (GUI_name)`. The `GUI_name` option corresponds to the name which will be displayed in the ingredient list, in the recipe item lore. Arguments marked with () brackets are optional.
|
|
|
In order to setup a vanilla ingredient, use `vanilla <ITEM_TYPE> (display_name) (amount) (GUI_name)`. Set the vanilla item `display_name` to . to have no display name.
|
|
|
|
|
|
The ingredient list presented previously should look like this in game:\
|
|
|
![](https://i.imgur.com/jECX7PW.png)
|
|
|
|
|
|
## Setting up recipe conditions
|
|
|
Just like ingredients, conditions must be met in order to use a recipe. Unlike ingredients, conditions do not take anything from the player inventory when using a crafting recipe. There are several types of recipes conditions, the main being **level** conditions and **permission** conditions. Just like ingredients, conditions are stored in a list inside the recipe config section.
|
|
|
```
|
|
|
recipes:
|
|
|
steel-sword:
|
|
|
conditions:
|
|
|
- 'level 5'
|
|
|
- 'perms mmoitems.recipe.steel-sword mmoitems.recipe.station.steel'
|
|
|
```
|
|
|
|
|
|
If you want your recipe to be available only for players who are at least level X, use this: `level <required_level>`. If you want your recipe to be available only for players with specific permissions, use: `perms <perm1> <perm2> <perm3> ...`. Perm nodes must be separated using spaces.
|
|
|
The `hide-when-locked` recipe option only triggers when at least one of the conditions is/are not met. The recipe will still display in the GUI if the player does not have all the required ingredients. Recipe conditions display in |
|
|
\ No newline at end of file |