Skip to content

World Configuration

World settings use a two-layer system: WorldConfig (per-world, saved to disk) and GameplayConfig (asset-based, shared by name). Some WorldConfig fields can override GameplayConfig values.

Per-world configuration saved as config.json in each world’s directory. Saved automatically by WorldConfigSaveSystem every 10 seconds when changed.

WorldConfig config = world.getWorldConfig();
FieldTypeDefaultDescription
DisplayNameStringnullPlayer-facing world name
SeedlongcurrentTimeMillis()World generation seed
GameModeGameModeserver defaultDefault game mode for the world
GameplayConfigString"Default"Name of the GameplayConfig asset to use
FieldTypeDefaultDescription
IsPvpEnabledbooleanfalseWhether PvP damage is allowed
IsFallDamageEnabledbooleantrueWhether fall damage applies
IsSpawningNPCbooleantrueWhether NPCs can spawn
IsSpawnMarkersEnabledbooleantrueWhether spawn markers are active
IsAllNPCFrozenbooleanfalseWhether all NPCs are frozen
FieldTypeDefaultDescription
IsTickingbooleantrueWhether chunks tick
IsBlockTickingbooleantrueWhether blocks tick
IsGameTimePausedbooleanfalseWhether day/night cycle is paused
GameTimeInstant5:30 AMCurrent in-game time of day
ForcedWeatherStringnullForce a specific weather type (validated against Weather assets)

See World Time for the time system.

FieldTypeDefaultDescription
IsSavingPlayersbooleantrueWhether player data is saved
IsSavingChunksbooleantrueWhether chunk data is saved to disk
SaveNewChunksbooleantrueWhether newly generated chunks are marked for saving
IsUnloadingChunksbooleantrueWhether chunks can unload
DeleteOnUniverseStartbooleanfalseDelete world on universe load
DeleteOnRemovebooleanfalseDelete world files when removed from server

See Chunk Saving for the save system.

Nested under ChunkConfig:

FieldTypeDefaultDescription
PregenerateRegionBox2DnullRegion to pregenerate on world start
KeepLoadedRegionBox2DnullRegion of chunks that never unload

Nested under ClientEffects. These affect rendering on the client:

FieldTypeDefaultDescription
SunHeightPercentfloat100.0Sun height percentage
SunAngleDegreesfloat0.0Sun angle in degrees
BloomIntensityfloat0.3Post-processing bloom intensity
BloomPowerfloat8.0Post-processing bloom power
SunIntensityfloat0.25Sun light intensity
SunshaftIntensityfloat0.3Sunshaft/god-ray intensity
SunshaftScaleFactorfloat4.0Sunshaft scale
ClientEffectWorldSettings effects = config.getClientEffects();
effects.setSunHeightPercent(80.0f);
effects.setBloomIntensity(0.5f);
FieldTypeDefaultDescription
SpawnProviderISpawnProvidernull (worldgen default)Controls where new players spawn
IsCompassUpdatingbooleantrueWhether compass updates
IsObjectiveMarkersEnabledbooleantrueWhether objective markers are visible
RequiredPluginsMapemptyMods required for this world

Three GameplayConfig values can be overridden directly on WorldConfig. When set, they take precedence over the GameplayConfig asset:

Override FieldOverrides
DeathDeathConfig — inline death config
DaytimeDurationSecondsDay/night duration
NighttimeDurationSecondsDay/night duration
// the World class resolves overrides automatically
DeathConfig deathConfig = world.getDeathConfig(); // checks WorldConfig override first
int daytime = world.getDaytimeDurationSeconds(); // checks WorldConfig override first

Asset-based configuration loaded from JSON. A world references a GameplayConfig by name (defaults to "Default"). Multiple worlds can share the same GameplayConfig.

GameplayConfig gameplay = world.getGameplayConfig();

GameplayConfig contains multiple sub-configs, each controlling a different system.

Controls item loss on death and respawn behavior. See Death for the full death flow.

DeathConfig deathConfig = world.getDeathConfig();
FieldDefaultDescription
RespawnControllerHomeOrSpawnPointWhere to respawn (see below)
ItemsLossModeNONENONE = keep all items, ALL = drop everything, CONFIGURED = use percentages below
ItemsAmountLossPercentage10.0% of stackable item quantity lost (when mode is CONFIGURED)
ItemsDurabilityLossPercentage10.0% of durability lost from all items on death

Respawn controllers determine where the player teleports on respawn:

TypeBehavior
HomeOrSpawnPoint (default)Teleports to nearest valid respawn point (bed/campfire), or world spawn if none set
WorldSpawnPointAlways teleports to world spawn
ExitInstanceExits the current instance (falls back to HomeOrSpawnPoint on failure)

Controls respawn point limits (beds, campfires, etc.):

FieldDefaultDescription
RadiusLimitRespawnPoint500Max block radius for respawn points
MaxRespawnPointsPerPlayer3Max respawn points per player
FieldDefaultDescription
OutOfCombatDelaySeconds5.0Seconds before entity is considered “out of combat”
StaminaBrokenEffectId"Stamina_Broken"Effect applied when stamina depleted
DisplayHealthBarstrueShow health bars above entities
DisplayCombatTexttrueShow combat text (damage numbers)
DisableNPCIncomingDamagefalseMake all NPCs invulnerable
DisablePlayerIncomingDamagefalseMake all players invulnerable
FieldDefaultDescription
MovementConfig"BuiltinDefault"Movement config preset ID
HitboxCollisionConfignullHitbox collision config ID
RepulsionConfignullRepulsion config ID
MaxDeployableEntities-1 (unlimited)Max simultaneous deployable entities per player
ArmorVisibilityOptionALLWhich armor pieces can be hidden (ALL, HELMET_ONLY, NONE)
FieldDefaultDescription
AllowBlockBreakingtrueWhether blocks can be broken (checked before BreakBlockEvent)
AllowBlockGatheringtrueWhether blocks can be gathered
AllowBlockPlacementtrueWhether blocks can be placed (checked before PlaceBlockEvent)
BlockPlacementFragilityTimer0.0Seconds after placement during which blocks are instantly breakable
DaytimeDurationSeconds1728Real-world seconds for daytime
NighttimeDurationSeconds1728Real-world seconds for nighttime
TotalMoonPhases5Number of moon phases

Nested under World.Sleep:

FieldDefaultDescription
WakeUpHour5.5 (5:30 AM)In-game hour players wake up at
AllowedSleepHoursRangenull (unrestricted)In-game hour range during which sleep is allowed
FieldDefaultDescription
BenchMaterialChestHorizontalSearchRadius14Horizontal radius to find chests near a crafting bench
BenchMaterialChestVerticalSearchRadius6Vertical radius to find chests near a crafting bench
BenchMaterialChestLimit100Max chests a bench draws materials from

Nested under ItemDurability.BrokenPenalties:

FieldDefaultDescription
ToolnullPenalty multiplier for broken tools
ArmornullPenalty multiplier for broken armor
WeaponnullPenalty multiplier for broken weapons

Nested under ItemEntity:

FieldDefaultDescription
PickupRadius1.75Radius at which items are picked up
Lifetimenull (no expiry)Time in seconds before dropped items despawn
ShowItemParticlestrueWhether to show particles on dropped items
ParticleSystemId"Item"Particle system for item entities

Controls what appears on the player’s world map:

FieldDefaultDescription
DisplaySpawntrueShow spawn point
DisplayHometrueShow home location
DisplayWarpstrueShow warp points
DisplayDeathMarkertrueShow death location
DisplayPlayerstrueShow other players
FieldDefaultDescription
DamageEffectsnullMap of DamageCause ID to CameraEffect ID
FieldDefaultDescription
FirstSpawnParticlesnullParticles shown on a player’s first spawn in the world
SpawnParticlesnullParticles shown on subsequent spawns
MaxEnvironmentalNPCSpawns500Max environmental NPC spawns in the world

Controls effects when gathering blocks incorrectly:

FieldDefaultDescription
UnbreakableBlock.ParticleSystemIdParticle when hitting unbreakable blocks
UnbreakableBlock.SoundEventIdSound when hitting unbreakable blocks
IncorrectTool.ParticleSystemIdParticle when using wrong tool
IncorrectTool.SoundEventIdSound when using wrong tool
FieldDefaultDescription
ShowItemPickupNotificationstrueShow item pickup notifications
CreativePlaySoundSetnullSound set used in creative mode

Both WorldConfig and GameplayConfig have a Plugin codec map that allows mods to register their own sub-configs via the Codec Registry. Built-in mods use this for stamina tuning, portal settings, reputation, stash systems, and more.

// register a custom gameplay config type in setup()
getCodecRegistry(GameplayConfig.PLUGIN_CODEC)
.register(Priority.NORMAL, "MyModConfig", MyModConfig.class, MyModConfig.CODEC);

This allows your settings to appear in the GameplayConfig JSON:

{
"Plugin": {
"MyModConfig": {
"MySetting": 42
}
}
}