Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Mining levels

Felix Beinssen edited this page Dec 1, 2022 · 14 revisions

In MiningLevels, players level up by mining blocks to gain XP. The levels are defined in the config/levels.json file and must be in sorted order. So from the first to the last level.
You should always use the ingame level editor to edit levels.

General structure

A level is defined as follows:

[
  {
    "name": "1",
    "nextLevelXP": 100,
    "ordinal": 0,
    "instantBreakProbability": 0.0,
    "extraOreProbability": 0.0,
    "maxExtraOre": 0.0,
    "hasteLevel": 0,
    "commands": [
      "say Congrats :)"
    ],
    "rewards": [
      {
        "type": "DIAMOND",
        "amount": 10
      }
    ]
  }
]

Persons who know json should understand this relatively easily. All others should always copy the inner object in the braces and adapt it.

Properties

name

The display name of each level.

ordinal

The number of the level. Starting at zero. Means that level 1 is ordinal: 0.

nextLevelXP

XP needed to reach the next level.

instantBreakProbability

The probability, a player at this level, will break a block instantly.

extraOreProbability

The probability, extra ores will drop, once a player breaks a block.

maxExtraOre

The maximum amount of dropped extra ores.

hasteLevel

The level of haste effect a player gets, whenever he attempts to break a mining block.

commands

This requires PlaceholderAPI to be installed!!!
(since 1.1.0)Commands that will be called, when the player levels up to this level.
(since 1.2.9)Commands can be called by the console with the prefix "console:" or by the player with the prefix "player:".

    "commands": [
      "console:op %ml_player_name%",
      "player:say Hey guys I %ml_player_name reached %ml_level% in Mining!"
    ],

rewards

(since 1.1.0)rewards need to be structured like the following and separated by a comma. The minimum information provided about a reward is the type. The type has to be one out of this list.

      {
        "type": "DIAMOND",
        "amount": 10
      }

Adding more levels.

To add a new mining level, just add a new element as shown in the following.

[
  {
    "name": "1",
    "nextLevelXP": 100,
    "ordinal": 0,
    "instantBreakProbability": 0.0,
    "extraOreProbability": 0.0,
    "maxExtraOre": 0.0,
    "hasteLevel": 0,
    "commands": [
      "console:say wow, next level :)"
    ],
    "rewards": [
      {
        "type": "DIAMOND",
        "amount": 10
      }
    ]
  },
  {
    "name": "2",
    "nextLevelXP": 300,
    "ordinal": 1,
    "instantBreakProbability": 5.0,
    "extraOreProbability": 10.0,
    "maxExtraOre": 0.0,
    "hasteLevel": 0,
    "commands": [],
    "rewards": []
  }
]

Each level needs to be separated by a comma. They must be sorted by ordinal!