Описание
Server-side mod to create, configure and teleport between multiple custom dimensions at runtime - each world with its own inventory, gamemode, difficulty, gamerules and worldborder. All via simple /cw commands. **Vanilla clients can connect and use /cw tp - no client install needed.**
Active Versions: 1.21.1 (NeoForge / Fabric)
# See it in action

# Features
* **Runtime dimension creation** - `NORMAL`, `FLAT`, `NETHER` or `END` generation, with optional seed.
* **Per-world isolated state** - every dim can have its own:
* Default gamemode (applied on arrival)
* Inventory pool (shared with other "shared" worlds, or fully isolated)
* Gamerule overrides (with `reset` to revert)
* Difficulty (custom dims only)
* Worldborder (full `/worldborder` feature parity)
* Public flag - let non-OP players teleport there
* **Smart teleport** - remembers each player's last position in every dim; safe-spawn detection on first visit (including Nether ceiling handling).
* **Persistent across restarts** - worlds, configs, player positions, inventories.
* **Death respawn** - dying in a custom dim respawns you there (unless your bed is elsewhere).
* **Vanilla-client compatible** - no client mod required.
* **Deletion safety** - `/cw delete` requires confirmation, wipes files and all related per-player buckets.
# Commands
All commands hang off `/cw`. Public commands are visible to everyone; admin commands require the configured permission level (OP 4 by default).
## Public
* `/cw help` - list commands available to you
* `/cw tp ` - teleport (admins: any dim; players: public worlds only)
* `/cw list` - list worlds (filtered by permission)
## Admin - world management
* `/cw create [seed]`
* Type: `NORMAL`, `FLAT`, `NETHER`, `END`
* Examples:
* `/cw create myworld NORMAL`
* `/cw create skyblock FLAT 12345`
* `/cw create hellscape NETHER`
* `/cw delete ` - confirm within 30 seconds by re-running the same command
## Admin - per-world config (run from inside the dim)
* `/cw config` - show the current dimension's full config
* `/cw config sharedinventory ` - share inventory with other shared worlds, or use a fully isolated pool
* `/cw config gamemode ` - gamemode applied on arrival
* `/cw config publicWorld ` - allow non-OP players to `/cw tp` here
* `/cw config difficulty ` - per-dim difficulty (custom dims only)
* `/cw config worldborder ...` - same arguments as vanilla `/worldborder`, but applied to the current dim:
* `set []`, `add []`
* `center `
* `damage amount `, `damage buffer `
* `warning distance `, `warning time `
* `get`
* `/cw config gamerule [ [|reset]]`
* No args: list all rules (overridden ones flagged with `*`)
* ``: query
* ` `: override the rule for this dim
* ` reset`: remove the override, revert to default

# Permissions
The OP level required for admin commands is configurable in `config//serverconfig/customworlds-server.toml`:
```
permissionLevel = 4 # 0-4, OP level required for admin commands
maxWorlds = 0 # 0 = unlimited; hard cap for /cw create
deleteConfirmSeconds = 30 # 5-600
```
`/cw tp` and `/cw list` always remain available to everyone (filtered by the per-world `publicWorld` flag).
# Inventory model
Each player has one inventory snapshot per "bucket":
* **Shared bucket** - used by every dim where `sharedInventory = true` (the overworld is shared by default). All shared worlds use the same inventory.
* **Isolated bucket** - one per dim where `sharedInventory = false`. The dim has its own private inventory pool; you keep your shared inventory intact when you go in and out.
Buckets persist on disk and survive restarts. Logging out from an isolated dim snapshots your inventory immediately.

# Storage
Saved alongside the world data:
| File |Purpose |
| ------------------------------------------------------------------------ |------------------------------------------------ |
| customworlds.json |List of created worlds |
| customworlds_config.json |Per-dim config |
| customworlds_positions.json |Per-player, per-dim last positions |
| customworlds_inventories/<uuid>/<bucket>.dat |NBT inventory + XP snapshots |
| dimensions/customworlds/<name>/ |Standard MC dimension data (chunks, entities, …) |
Deleting a world wipes all of the above for that dim. Irreversible.
# Compatibilities
Custom Worlds is compatible with **Curios API** (NeoForge) & **Trinkets** (Fabric), the inventory will sync when these mods are installed.
# Limitations
* **`doDaylightCycle` per-dim has no visible effect** - game time is shared with the overworld through `DerivedLevelData`. Day/night follows the overworld.
* **Per-dim difficulty** only works on `customworlds:*` dims (it would conflict with vanilla's global difficulty for `minecraft:*` dims). For vanilla dims use `/difficulty`.
* **Server restart recommended after `/cw create`** - newly-created worlds run on a fallback tick loop until the next restart, after which they integrate normally. The mod tells you so on creation.
* Dynamic dimension registration uses reflection against `MinecraftServer` internals. **Back up your save before updating NeoForge.**
# FAQ
**Do my players need to install the mod?** No. CustomWorlds is server-side only. Vanilla clients can connect and use `/cw tp` for public worlds.
**Are the worlds compatible with vanilla?** Yes. Custom dims reuse the vanilla `OVERWORLD`/`NETHER`/`END` dimension types, so vanilla clients recognize them without extra registry data.
**What happens if a player is offline when their world gets deleted?** On reconnect, vanilla falls back to the overworld spawn. They'll arrive with whatever inventory was saved in their player.dat at last logout.
**Can I edit the JSON files manually?** Yes - they're plain JSON. The loaders tolerate per-entry malformed data and log which entry was skipped.
**Can I get more help about Custom Worlds ?** Sure ! Join our discord at https://discord.gg/XNAeUSYswB