Create a Custom Game Rule for Your World
Setting Up Your Custom Rule
Custom game rules let you define unique gameplay mechanics for individual worlds. Open your world's configuration folder and locate the Rules4Worlds JSON file.
Adding the Rule
1. Open the JSON configuration file in a text editor
2. Navigate to the rules section or create one if it doesn't exist
3. Define your rule with a unique name, description, and default value
4. Specify the rule type (boolean, integer, string, etc.) to control what values players can set
5. Save the file and reload your world
Once added, use the in-game command system to check and modify the rule without restarting. The rule will apply only to this world—other saves won't be affected.
Testing Your Rule
Use the custom command controls to verify the rule appears in-game and responds to changes. You can query its current value and adjust it as needed. Rules persist in your JSON file, so they'll remain even after closing and reopening the world.