> For the complete documentation index, see [llms.txt](https://docs.mantic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mantic.dev/manticrods/configuration-files/enchants-json.md).

# enchants.json

ManticRods Configuration Files

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\
**shardsPer** - this is the amount of the plugin currency that is given when the enchant activates\
**additionalShardsPerUpgrade** - additional amount of plugin currency per level\
**commandDispatchType** - `"ALL"` runs every command, `"RANDOM"` chooses one evenly, and `"CHANCE"` selects one by weighted random choice. In `"CHANCE"` mode, add `CHANCE:<weight>` to each command; weights are relative, so 80/15/5 gives 80%/15%/5%. The `chance` field controls whether the enchant activates before this outcome is chosen.\
**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
    }
```

\
\
\
*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)

## Weighted command selection

The built-in Spawner Finder currently has one Blaze reward and uses `RANDOM`. To make different spawner types rarer or more common, set its `commandDispatchType` to `"CHANCE"` and give each command a relative weight. This example makes zombie spawners common, skeleton spawners less common, and blaze spawners rare:

```json
{
  "id": "spawner_finder",
  "chance": 5.0,
  "chancePerUpgrade": 0.1,
  "commands": [
    "ss give {player} zombie 1 CHANCE:80",
    "ss give {player} skeleton 1 CHANCE:15",
    "ss give {player} blaze 1 CHANCE:5"
  ],
  "commandDispatchType": "CHANCE",
  "defaultLevel": 1,
  "maxLevel": 15,
  "messages": [
    "§e§lTREASURE §8§l| §dYou were lucky and found a spawner while using your fishing rod!"
  ],
  "requiredPrestigeLevel": 0
}
```

The weights are normalized against their total; weights adding up to 100 read directly as percentages. The enchant's `chance` and `chancePerUpgrade` still determine whether it activates at all. Replace these example commands with commands supported by your spawner plugin.

## 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": "shard_finder",
      "chance": 100.0,
      "chancePerUpgrade": 0.0,
      "shardsPer": 1,
      "additionalShardsPerUpgrade": 1,
      "defaultLevel": 1,
      "maxLevel": 15,
      "requiredPrestigeLevel": 0
    },
    {
      "id": "key_finder",
      "chance": 5.0,
      "chancePerUpgrade": 0.1,
      "commands": [
        "crate give {player} default 1"
      ],
      "commandDispatchType": "RANDOM",
      "defaultLevel": 1,
      "maxLevel": 15,
      "messages": [
        "§e§lTREASURE §8§l| §dYou were lucky and found a key while your their fishing rod!"
      ],
      "requiredPrestigeLevel": 0
    },
    {
      "id": "spawner_finder",
      "chance": 5.0,
      "chancePerUpgrade": 0.1,
      "commands": [
        "ss give {player} blaze 1"
      ],
      "commandDispatchType": "RANDOM",
      "defaultLevel": 1,
      "maxLevel": 15,
      "messages": [
        "§e§lTREASURE §8§l| §dYou were lucky and found a spawner while using your fishing rod!"
      ],
      "requiredPrestigeLevel": 0
    },
    {
      "id": "drop_booster",
      "chance": 100.0,
      "chancePerUpgrade": 0.0,
      "defaultLevel": 1,
      "maxLevel": 15,
      "extraDropsPerLevel": 1.0,
      "requiredPrestigeLevel": 0
    },
    {
      "id": "autosell",
      "chance": 100.0,
      "chancePerUpgrade": 0.0,
      "defaultLevel": 0,
      "maxLevel": 1,
      "autosell": true,
      "requiredPrestigeLevel": 0
    },
    {
      "id": "money_finder",
      "chance": 5.0,
      "chancePerUpgrade": 0.1,
      "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 their fishing rod!"
      ],
      "requiredPrestigeLevel": 0
    },
    {
      "id": "exp_finder",
      "chance": 5.0,
      "chancePerUpgrade": 0.1,
      "expPer": 500,
      "additionalExpPerUpgrade": 250,
      "defaultLevel": 1,
      "maxLevel": 15,
      "messages": [
        "§e§lTREASURE §8§l| §dYou were lucky and found exp while your fishing rod!"
      ],
      "requiredPrestigeLevel": 0
    },
    {
      "id": "haste",
      "chance": 1.0,
      "chancePerUpgrade": 0.0,
      "defaultLevel": 0,
      "maxLevel": 3,
      "holdingPotions": [
        "FAST_DIGGING:-1"
      ],
      "holdingPotionsAmplifierIncreasePerLevel": 1,
      "requiredPrestigeLevel": 0
    },
    {
      "id": "time_booster",
      "chance": 100.0,
      "chancePerUpgrade": 0.0,
      "defaultLevel": 1,
      "maxLevel": 30,
      "lessTicksPerUpgrade": 14,
      "requiredPrestigeLevel": 0
    }
  ],
  "useLegacyChances": false
}
```

{% endcode %}
