# enchants.json

Below is some help regarding to this file, if you did not know already you can make AS MANY enchants you want using the **Enchant Fields** found below in enchants.json following JSON formatting.

## Enchant Fields

**enabled** - whether the enchant is enabled or not\
**id** - unique identifier for the enchant\
**defaultLevel** - the default level of the enchant\
**maxLevel** - the highest level that the enchant can be upgraded to\
**chance** - the likelihood of the enchant activating  \
**chancePerUpgrade** - for every additional level of an enchant, this provides a greater chance of activating\
**crystalsPer** - this is the amount of the plugin currency that is given when the enchant activates\
**additionalCrystalsPerUpgrade** - additional amount of plugin currency per level\
**commandDispatchType** - "RANDOM" or "ALL" (self-explanatory)\
**commands** - commands (without /) that can be ran when the enchant activates (array)\
**messages** - these are sent to the player when the reward is activated (array)\
**publicBroadcastMessageWhenActivated** - a single message broadcasted on activation\
**extraDropsPerLevel** - refers to how much extra drops is given per level\
**expPer** - exp per activation\
**additionalExpPerUpgrade** - extra exp per activation\
**moneyPer** - money per activation\
**additionalMoneyPerUpgrade** - extra money per activation\
**holdingPotionsAmplifierIncreasePerLevel** - increase in potion amplifier per level\
**holdingPotions** - e.g. "FAST\_DIGGING:-1"  - format is POTION:AMPLIFIER (array)

**customEconomy** - Vault economy name or class\
**customEconomyPer** - amount of custom economy\
**additionalCustomEconomyPerUpgrade** - additional amount of custom economy per upgrade\
Example:

Ability to natively hook into multiple vault economies, below is an **example** of how to implement it in enchants.json ("GoldEconomy" is a made up plugin for showcase purpose only)

```json
    {
      "id": "gold",
      "chance": 100.0,
      "chancePerUpgrade": 0.0,
      "defaultLevel": 0,
      "maxLevel": 1,
      "customEconomy": "GoldEconomy",
      "customEconomyPer": 1,
      "additionalCustomEconomyPerUpgrade": 1
    }
```

\
\
\
\&#xNAN;*Fields above labelled '(array)' must be in an array (list format) - use this for guidance:* [*https://www.w3schools.com/js/js\_json\_arrays.asp*](https://www.w3schools.com/js/js_json_arrays.asp)

## Having errors relating to this file/json?

Copy and paste the contents of the file into <https://codebeautify.org/jsonvalidator> and click "Validate JSON", it should then provide steps to where a config error might have occurred.

{% code lineNumbers="true" %}

```json
{
  "enchants": [
    {
      "id": "crystal_finder",
      "chance": 25.0,
      "chancePerUpgrade": 0.3,
      "crystalsPer": 1,
      "additionalCrystalsPerUpgrade": 1,
      "defaultLevel": 1,
      "maxLevel": 15
    },
    {
      "id": "key_finder",
      "chance": 5.0,
      "chancePerUpgrade": 0.3,
      "commands": [
        "crate give {player} default 1"
      ],
      "commandDispatchType": "RANDOM",
      "defaultLevel": 1,
      "maxLevel": 15,
      "messages": [
        "&e&lTREASURE &8&l| &dYou were lucky and found a &l&nkey&r&d while using your mob sword!"
      ]
    },
    {
      "id": "spawner_finder",
      "chance": 5.0,
      "chancePerUpgrade": 0.3,
      "commands": [
        "ss give {player} blaze 1"
      ],
      "commandDispatchType": "RANDOM",
      "defaultLevel": 1,
      "maxLevel": 15,
      "messages": [
        "&e&lTREASURE &8&l| &dYou were lucky and found a &l&nspawner&r&d while using your mob sword!"
      ]
    },
    {
      "id": "drop_booster",
      "chance": 25.0,
      "chancePerUpgrade": 1.0,
      "defaultLevel": 1,
      "maxLevel": 15,
      "extraDropsPerLevel": 1
    },
    {
      "id": "autosell",
      "chance": 100.0,
      "chancePerUpgrade": 0.0,
      "defaultLevel": 0,
      "maxLevel": 1,
      "autosell": true
    },
    {
      "id": "money_finder",
      "chance": 5.0,
      "chancePerUpgrade": 0.3,
      "defaultLevel": 1,
      "maxLevel": 15,
      "moneyPer": 5000.0,
      "additionalMoneyPerUpgrade": 2500.0,
      "messages": [
        "&e&lTREASURE &8&l| &dYou were lucky and found &l&n{0}&r&d while using your mob sword!"
      ]
    },
    {
      "id": "exp_finder",
      "chance": 5.0,
      "chancePerUpgrade": 0.3,
      "expPer": 500,
      "additionalExpPerUpgrade": 250,
      "defaultLevel": 1,
      "maxLevel": 15,
      "messages": [
        "&e&lTREASURE &8&l| &dYou were lucky and found &l&nexp&r&d while using your mob sword!"
      ]
    },
    {
      "id": "haste",
      "chance": 100.0,
      "chancePerUpgrade": 0.0,
      "defaultLevel": 0,
      "maxLevel": 3,
      "holdingPotions": [
        "FAST_DIGGING:-1"
      ],
      "holdingPotionsAmplifierIncreasePerLevel": 1
    }
  ],
  "useLegacyChances": false
}
```

{% endcode %}
