Skip to content

🎛️ Game Rule Presets & Controls

ParameterSpecification
Preset Engine Classnet.instantgratification.collapsiblegamerules.preset.GameRulePresetEngine
Preset Data Structurerecord Preset(String id, Component displayName, Map<String, Object> ruleValues)
Interactive WidgetsIntegerSliderWidget, BooleanToggleWidget
Slider Helpernet.instantgratification.collapsiblegamerules.util.GameRuleSliderHelper
Toggle On Color0x4400FF00 (Emerald Green Background)
Toggle Off Color0x44FF0000 (Ruby Red Background)
Built-in Presetsbuilder ("🏰 Builder Mode"), fast_play ("⚡ Fast Play"), hardcore ("💀 Hardcore Realism")

📖 Overview

Collapsible Game Rules includes interactive UI controls and built-in Game Rule presets, allowing players to configure complex world settings with single-click profiles or intuitive sliders instead of typing raw integer values into text boxes.


🏰 Built-in Presets Matrix

The GameRulePresetEngine provides three pre-configured gameplay presets:

Preset IDDisplay TitleGame RuleConfigured ValueGameplay Impact
builder🏰 Builder ModedoDaylightCycle
doWeatherCycle
doMobSpawning
keepInventory
mobGriefing
doFireTick
false
false
false
true
false
false
Ideal for creative building: freezes sun/weather, stops mob spawns, disables creepers/fire spread.
fast_play⚡ Fast PlayrandomTickSpeed
playersSleepingPercentage
keepInventory
10
0
true
Fast-paced survival: accelerates crop growth ($3\times$), allows single-player sleep skipping, keeps inventory.
hardcore💀 Hardcore RealismnaturalRegeneration
doInsomnia
playersSleepingPercentage
false
true
100
Extreme survival: disables passive health regen (golden apples/potions required), enforces phantom spawns.

🎚️ Interactive Slider Widget (IntegerSliderWidget)

The IntegerSliderWidget replaces raw numeric text fields with draggable sliders for smooth integer adjustments.

Mathematical Normalization Formulas

When setting a slider position from an integer value $v$: $$\text{normalized} = \frac{\text{clamp}(v, \text{min}, \text{max}) - \text{min}}{\text{max} - \text{min}}$$

When computing the resulting integer value from the slider position $p \in [0.0, 1.0]$: $$\text{calculatedInt} = \text{min} + \text{round}\left(p \times (\text{max} - \text{min})\right)$$

Vanilla Game Rule Bounds (GameRuleSliderHelper)

GameRule KeyMinimum ($\text{min}$)Maximum ($\text{max}$)Vanilla Default
randomTickSpeed01003
spawnRadius03210
playersSleepingPercentage0100100
maxEntityCramming010024
maxCommandChainLength06553665536
commandModificationBlockLimit06553632768

🔘 Boolean Toggle Widget (BooleanToggleWidget)

The BooleanToggleWidget provides instant visual feedback for binary rules:

  • State: TRUE (ON): Renders ✔ ON in ChatFormatting.GREEN over a green background fill (0x4400FF00).
  • State: FALSE (OFF): Renders ✖ OFF in ChatFormatting.RED over a red background fill (0x44FF0000).
  • Mouse Press: Single click toggles state and executes the consumer callback onToggle.accept(newState).
┌─────────────────────────┐     ┌─────────────────────────┐
│         ✔ ON            │     │         ✖ OFF           │
│   (Green Tint 0x4400FF00)│     │   (Red Tint 0x44FF0000) │
└─────────────────────────┘     └─────────────────────────┘

Official documentation & web portal for Dasik Igaijinn mods.