How to Make a Game Rule in Minecraft (Mod Maker guide)

Learn how to create a custom Game rule in 9Minecraft Mod Maker right in your browser. A Game rule is a customizable parameter for a specific in-game world.

  1. Open the Studio and your workspace

    Open 9Minecraft Mod Maker in your web browser. There is nothing to download or install.

    Open an existing workspace or start a new one. Make sure your workspace uses one of the supported versions for this element, which are NeoForge 26.1.2 or NeoForge 1.21.1.

  2. Add a Game rule element

    Click the green plus button in your workspace to create a new mod element.

    Find the World generation group and select Game rule to open the editor.

  3. Set the Machine name and display name

    Fill in the Machine name field first. This is the game rule name which is displayed in-game in commands to modify or enable the game rules.

    Next, type a friendly title into the Game rule name field. This is the display name used on the game rules setting screen.

  4. Write the Game rule description

    Find the Game rule description field.

    Write a clear explanation of what your rule does. This text is used on the game rules setting screen when a player hovers over your game rule.

  5. Choose the Category

    Look at the Category field. It is used for the classification of the game rules depending on what they do.

    You can use vanilla names from the dropdown to use existing vanilla game rule categories, or enter a custom name to use mod-namespaced game rule categories.

  6. Pick the Game rule type and Default value

    In the Game rule type field, select the best type depending on your plans. Choose Number if the game rule can only be modified to be an integer, or choose Logic if the game rule can only be a boolean (true or false).

    Then fill in the Default value field. Your game rule will have this value until a player or a command in the game changes it.

  7. Save, test with Build & run, and export

    Save your new Game rule element in the editor.

    Click Build & run to test your rule in a world, check it on the game rules setting screen, and try changing it with commands. When everything works, export your mod.

Tips

Try it in the Studio All game rule fields explained →