# Create your enchantments

This page will help you create your own enchantments.

### First step - Create the enchant file

Create a file called `<enchant_name>.yml` into the `./plugins/Nebula/enchants/` folder.

### Second step - Edit the properties

#### Enchantment name

This is the name of the enchantment, it must be lowercase and not contain any space. This will be the name you'll use to find it in game.

`enchantment_name: abyss`

#### Displayed name

This is the name that will be displayed on the items, you can use the group color (see [groups](https://alex-plugins.gitbook.io/nebula/groups "mention")) using `%group_color%` or your own color with Vanilla color code.

`displayed_name: "%group_color%Abyss"`

#### Description

The description will be shown on the Enchant Book corresponding to this enchant. You can use `%level%` as a placeholder to replace the book level, you can also compute a formula using the compute formula (the level placeholder can be included in the formula : `compute_{%level%*2}`. More infos about descriptions can be found here : [description](https://alex-plugins.gitbook.io/nebula/main-mechanics/description "mention")

`description: "&fIncrease damages by &ccompute_{%level%*2}%"`

#### Maximum enchant level

This is the maximum enchant level that won't be able to be exceeded either by the enchant book or on the item.

`level_max: 5`

#### Group

This is the enchant group, by defining an enchant as a part of a group, it will gain all of its properties. The group has to be defined. (see [groups](https://alex-plugins.gitbook.io/nebula/groups "mention"))

`group: superior`

#### Items type

The items type define the items that can receive this enchantment, you can write here multiple items, and/or group of items. Items can be found [here](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html), and the groups are :

* **all** : can be applied to every item (weapons, tools, armor, shield)
* **weapons** : all axes, swords and trident
* **distance\_weapons** : bow, crossbow, trident
* **tools** : all pickaxes, shovels, hoes, axes, fishing rod and shears
* **swords** : all swords
* **axes** : all axes
* **armor** : all boots, chestplates, helmets, leggings
* **boots** : all boots
* **shovels** : all shovels
* **pickaxes** : all pickaxes
* **helmets** : all helmets
* **leggings** : all leggings
* **chestplates** : all chestplates
* **hoes** : all hoes
* **mana\_holders** : all weapons, distance\_weapons and tools

`items_type: bow, crossbow`

#### Conflicts enchants

If the name specified in [#enchantment-name](#enchantment-name "mention") of another enchant is specified here, players won't be able to apply this enchant that contains one of these enchants.

`conflicts_enchants:`

`- "enchant1"`

`- "enchant2`

#### Trigger

The trigger is the way the enchant will be triggered (see how triggers work here [triggers](https://alex-plugins.gitbook.io/nebula/main-mechanics/triggers "mention")).

`trigger: distance_hit<all>`

#### Mana required

This will define how many mana is necessary to execute the effect. If the amount is more than 0, the item will need a mana bar on it and the current mana amount on the item superior to the necessary amount (see [mana](https://alex-plugins.gitbook.io/nebula/mana "mention")).

`mana_required: 30-%level%*5`

#### Chance

This defines the chance for the effect to be applied. A chance of `0` mean that the effect will never be applied and `100` will be applied all the time (more infos on [chances](https://alex-plugins.gitbook.io/nebula/main-mechanics/chances "mention")).

`chance : %level%*2`

#### Conditions to enchant

Conditions to enchants are conditions that have to be met to apply an enchant book. Here is an example of how to avoid a player to enchant an item except in the world called *my\_world* :

`conditions_enchanting:`

`- "%player_world%[IS]my_world"`

#### Conditions to activate

Conditions to activate have the same format as [Conditons to enchant](#conditions-to-enchant). They must be all verified before effects activation (to learn how to create conditions, see [conditions](https://alex-plugins.gitbook.io/nebula/main-mechanics/conditions "mention")).&#x20;

`conditions_activation:`

`- "@player_item_in_hand@[IS]BOW"`

#### Effects&#x20;

Effects are activated if conditions are met (to learn how to create effects, see [effects](https://alex-plugins.gitbook.io/nebula/main-mechanics/effects "mention")).

`effects:`

`- "level[all]:ennemy[damage_add_%level%*0.25]"`

#### Items found in chests

You can prevent this enchant book from spawning in chests (see how chest spawning works here [chest-spawning](https://alex-plugins.gitbook.io/nebula/items/item-drop/chest-spawning "mention")).

`chest_found: true`

#### Items sold by villagers

You can prevent this enchant book from being sold by villagers (see [villagers](https://alex-plugins.gitbook.io/nebula/items/item-drop/villagers "mention")).

`villager_foundable: true`

#### Enchant found on enchant table

Enable or disable this enchant on enchant tables (see [enchant-tables](https://alex-plugins.gitbook.io/nebula/enchantments/enchant-tables "mention")).

`enchanting_table_foundable: true`

#### Possibility to fish

You can prevent this enchant book from being found by fishing with special rod (see [fishing](https://alex-plugins.gitbook.io/nebula/items/item-drop/fishing "mention")).

`possible_to_fish: true`

#### Emerald price

This is the price the enchant book can be bought on villagers (you can include %level% placeholder).

`emerald_price: "10*%level%"`

#### Permission

If this is enabled, the player will need a permission to use the enchant (effects won't be activated if the player doesn't have the permission).

`permission_needed: false`

{% hint style="info" %}
Placeholders from PlaceholdersAPI can be used everywhere in the enchant config (description, effects, conditions, chance, mana)
{% endhint %}
