Skip to content

Integration & Compatibility

Lean's edited this page Jun 9, 2025 · 91 revisions

Introduction

In this section there will be explanations of the classes, events and examples available for you to integrate your mod with LevelUP

LevelUP.ExperienceEvents

  • OnExperienceIncrease
  • Player receive experience, amount is a reference you can modify it to increase or decrease the quantity received

  • OnExperienceSubIncrease
  • Player receive sub experience, amount is a reference you can modify it to increase or decrease the quantity received

  • OnExperienceReduced
  • Player losed experience, amount is a reference you can modify it to increase or decrease the quantity received

LevelUP.Experience

  • GetExperience
  • Returns the player experience from a level type

  • GetSubExperience
  • Returns the player sub experience from a level type and sub level type

  • IncreaseExperience
  • Increase a player experience from a level type and action or amount

  • IncreaseSubExperience
  • Increase a player experience from a level type, sub level type and amount

Level Calculations

You can access all levelup calculation by using the class LevelUP.Configuration

Examples

  • Force reduce all experience
public override void StartServerSide(ICoreServerAPI api)
{
    LevelUP.ExperienceEvents.OnExperienceIncrease += LevelUPOnExperienceIncreased;
}

private void LevelUPOnExperienceIncreased(IPlayer player, string type, ref ulong amount)
{
    amount = (ulong)Math.Round(amount * 0.5);
}

Clone this wiki locally