Qubit Player XP

Quick rating

Community listing page, reviews here may not be monitored by the author.

Qubit Player XP

By mesosopicOwner

No reviews yet

A tiny, configurable mod intended for use in modpacks. Allows for configuration of the XP leveling and XP drop on death formulas.

Mod Loaders
Minecraft
26.3 26.2

About

Description

Qubit Player XP

A tiny, configurable mod intended for use in modpacks.

Allows for configuration of the XP leveling and XP drop on death formulas.

Usage

By default, this mod should change nothing.

It can be configured with a file at <mc folder>/config/qubit/player_xp.json, which looks like this:

{
  "level_formula": /* ... */,
  "xp_drop": /* ... */
}

Both level_formula and xp_drop are integer providers, and default to the formulas used in vanilla.

These integer providers are passed the player as their this entity for loot context.

Two integer providers have also been added to build formulas with:

qubit:player_xp/level

{
  "type": "qubit:player_xp/level"
}

Returns the player's current level. Can only be used in level_formula and xp_drop.

qubit:player_xp/points

{
  "type": "qubit:player_xp/points"
}

The number of experience points the player has towards the next level. Can only be used in xp_drop.

Example Config

This is the config with the default (vanilla) formulas:

{
  "level_formula": {
    "type": "minecraft:number_dispatcher",
    "cases": [
      {
        "condition": {
          "type": "minecraft:value_check",
          "value": { "type": "qubit:player_xp/level" },
          "range": { "min": 0, "max": 15 }
        },
        "number_provider": { // 2*level + 7
          "type": "minecraft:add",
          "inputs": [ 7, {
            "type": "minecraft:mul",
            "inputs": [ 2, { "type": "qubit:player_xp/level" } ]
          }]
        }
      },
      {
        "condition": {
          "type": "minecraft:value_check",
          "value": { "type": "qubit:player_xp/level" },
          "range": { "min": 16, "max": 30 }
        },
        "number_provider": { // 5*level - 38
          "type": "minecraft:add",
          "inputs": [ -38, {
            "type": "minecraft:mul",
            "inputs": [ 5, { "type": "qubit:player_xp/level" } ]
          }]
        }
      }
    ],
    "default": { // 9*level - 158
      "type": "minecraft:add",
      "inputs": [ -158, {
        "type": "minecraft:mul",
        "inputs": [ 9, { "type": "qubit:player_xp/level" } ]
      }]
    }
  },
  "xp_drop": { // min(100, 7*level)
    "type": "minecraft:minimum",
    "operands": [ 100, {
      "type": "minecraft:mul",
      "inputs": [ 7, { "type": "qubit:player_xp/level" } ]
    }]
  }
}

For the legacy 1.0 config, see the old version of this README.