HomeJavaModsDimSwap
ModsJava

DimSwap

by itzamirreza · on Modrinth

Per-dimension player state for NeoForge 1.21.1 — inventory, ender chest, XP, potion effects, Curios slots. Players auto-swap state when crossing between…

⬇ Download on Modrinth

DimSwap

Per-dimension player state isolation for NeoForge. Save and restore inventory, ender chest, XP, potion effects, hunger, gamemode, position, and Curios slots automatically when a player crosses between configurable dimension groups.

Build a creative test world that can't leak into survival — or a hardcore zone with its own progression, or a minigame dimension with its own loadout — entirely server-side, no client mods required, no datapack hacks.


Why this exists

NeoForge has no maintained "per-dimension inventory" mod for 1.21.1. The Fabric/Paper ecosystems do (Multiverse-Inventories, EasyAuth-adjacent tools), but on NeoForge you're stuck either spinning up a second server process or accepting that creative-mode players will accidentally drop creative items into the survival world.

DimSwap solves the second case: it hooks EntityTravelToDimensionEvent to atomically save the player's full state before the cross, and PlayerChangedDimensionEvent to atomically restore the state assigned to the destination's group. First-time visits get a clean wipe so nothing carries over.

Features

Installation

  1. Drop dimswap-X.Y.Z.jar into your server's mods/ folder.
  2. Optional: also drop on the client (only required if you want commands to autocomplete client-side; gameplay works server-only).
  3. Start the server once to generate config/dimswap.json.
  4. Edit the config to define your dimension groups (see below).
  5. Reload with /dimswap reload or restart the server.

Dependencies

Configuration

config/dimswap.json:

{
  "groups": {
    "default":  ["minecraft:overworld", "minecraft:the_nether", "minecraft:the_end"],
    "creative": ["dimswap_creative:flat"]
  },
  "save": {
    "enderChest": true,
    "xp": true,
    "effects": true,
    "food": true,
    "air": true,
    "fire": true,
    "health": false,
    "gamemode": true,
    "position": true,
    "curios": true
  },
  "aliases": [
    {"name": "creative", "dimension": "dimswap_creative:flat", "gamemode": "creative", "permissionLevel": 0},
    {"name": "survival", "dimension": "minecraft:overworld",   "gamemode": "survival", "permissionLevel": 0}
  ]
}

groups

A map of group name → list of dimension IDs. Dimensions in the same group share state. Dimensions in different groups have isolated state. Any dimension not listed falls into the default group.

save

Toggles for which player state fields to swap. health: false (default) leaves the player at their current health when crossing — flip to true if you want hardcore-style health-per-world.

aliases

Define shortcut commands. Each alias becomes a top-level command (e.g. /creative) that teleports the player to the target dimension at the target gamemode. permissionLevel: 0 means anyone can use it; 2 is op-only.

Note: aliases are registered at server startup. Adding/removing aliases requires a server restart. Changes to groups and save apply via /dimswap reload.

Commands

Command Permission Description
/dimswap go <dim> [gamemode] op (2) Teleport to a dimension, optionally set gamemode
/dimswap reload op (2) Reload config from disk
/dimswap status [player] op (2) Show which groups have saved snapshots for a player
/dimswap reset <player> <group> op (2) Wipe a player's snapshot for a group
/<alias> configurable Run a configured alias (e.g. /creative, /survival)

Caveats and known limitations

Building from source

./gradlew build
# Output: build/libs/dimswap-1.0.0.jar

Requires JDK 21.

License

MIT — see LICENSE.

Credits

Created out of necessity for a small Create-mod survival server that wanted a creative testing world without inventory contamination. The architecture is intentionally simple: a save event, a restore event, and per-player NBT storage.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more