tweakable-xp-loss

Quick rating

tweakable-xp-loss

No reviews yet

Configurable XP loss. Allows setting a percentage of XP to be kept after death, and can be set to drop as orbs or be awarded immediately upon respawn.

Mod Loaders
NeoForge
Minecraft
26.2

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Unsupported
Server Required

About

Project Details

Type
Mod
License
MIT License
Latest Version
1.1.0-mc1.21.11
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

Tweakable XP Loss

A small server-side NeoForge mod that lets you configure the percentage of experience points a player keeps after death, overriding the default vanilla XP loss.

Players do not need this mod installed on their client — it runs entirely on the server.

Supported versions

The mod ships as three jars, each compiled against its era's Minecraft/NeoForge APIs. Pick the one that covers your Minecraft version:

Jar Minecraft NeoForge
tweakable_xp_loss-<version>-mc1.21.1.jar 1.21.1 – 1.21.10 21.1.x – 21.10.x
tweakable_xp_loss-<version>-mc1.21.11.jar 1.21.11 21.11.x
tweakable_xp_loss-<version>-mc26.2.jar 26.2 26.2.x-beta

The 26.2 jar is published as a beta version: Minecraft 26.2 is a stable release, but NeoForge for 26.2 is itself still beta-only at the time of writing (no stable 26.2.x build yet). The mod's GameRules API on 26.x is identical to 1.21.11's, so the mod code is unchanged — only the compile target and Java toolchain (25 vs 21) differ. It will flip to a release version once NeoForge 26.2 ships a stable build.

Why multiple jars? Minecraft 1.21.11 restructured the GameRules API (the keepInventory gamerule moved package, changed type, and changed its accessor), and MC 26.x is a new major on top of that. Rather than rely on runtime reflection, each jar calls its era's API directly — compile-checked and obviously correct. See docs/PORTING.md.

Config

On first launch the mod creates config/tweakable_xp_loss-common.toml:

#Master switch. If false, the mod does nothing (pure vanilla XP loss).
enabled = true

#Percentage of experience points a player keeps through death (0-100).
# 100 = keep all XP (no loss).
# 0   = vanilla behavior (lose all XP).
# Range: 0 ~ 100
keepPercentage = 100

#How the kept XP is returned to the player:
# INSTANT = granted directly to the player on respawn (no orbs).
# ORBS    = dropped as experience orbs at the death location (recoverable; gravestone/corpse mods may collect them).
#Allowed Values: INSTANT, ORBS
awardMethod = "INSTANT"

Edit the file and run /reload (or restart the server) to apply changes.

What "keepPercentage" means

It is a percentage of the player's total accumulated experience points (the raw XP behind the levels bar), not a percentage of levels. For example, keepPercentage = 50 means a player respawns with half of the XP points they had before dying.

How it works (under the hood)

  1. When a player dies, vanilla normally scatters a small amount of XP as orbs at the death point (min(level * 7, 100) points) and resets the player's XP to 0 on respawn.
  2. This mod:
    • suppresses that small vanilla orb drop (via LivingExperienceDropEvent) so retained XP isn't double-counted, only when active;
    • returns the retained portion either directly on respawn (INSTANT, via PlayerEvent.Clone) or as orbs at the death location (ORBS, via LivingDeathEvent).

Compatibility with other death mods (CorPse, gravestones, …)

  • This mod never touches item drops, so it is fully compatible out-of-the-box with corpse/gravestone mods that only handle items.
  • When keepPercentage = 0 (or enabled = false), this mod performs no work at all and vanilla behavior is fully preserved, so any other mod's XP handling is untouched.
  • If you use a mod that manages experience on death (it stores your full XP in a grave and refunds it later), set keepPercentage = 0 to avoid this mod double-awarding XP.

Notes

  • The mod is a no-op when the keepInventory gamerule is enabled (vanilla already preserves XP then).
  • Builds with no client-side code; drop the built jar into the server's mods/ folder.

Building

Build the jar for a specific era (defaults to legacy):

./gradlew build                # legacy jar  -> build/libs/tweakable_xp_loss-<ver>-mc1.21.1.jar
./gradlew build -Pera=modern   # modern jar  -> build/libs/tweakable_xp_loss-<ver>-mc1.21.11.jar
./gradlew build -Pera=next     # next jar    -> build/libs/tweakable_xp_loss-<ver>-mc26.2.jar (Java 25)

Java 21 is required for the 1.21.x eras and Java 25 for the 26.x era; Gradle auto-downloads the needed toolchain if it is not installed.

Continuous integration & publishing

  • build workflow (.github/workflows/ci.yml) compiles the mod against every targeted Minecraft/NeoForge version on each push/PR — the cross-minor jobs act as a tripwire for API drift.
  • release workflow (.github/workflows/release.yml) triggers on a v* git tag: it builds all three jars, publishes each as a separate Modrinth version (via Minotaur), and attaches them to a GitHub Release. Requires a MODRINTH_TOKEN repository secret and an existing Modrinth project (slug tweakable-xp-loss).

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
CurseForge
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works