How to Make a Function in Minecraft (Mod Maker guide)

Learn how to create a custom Function in 9Minecraft Mod Maker right in your browser. A Function allows players to run command sets whenever it is called in the game.

  1. Open the Studio and a workspace

    Open 9Minecraft Mod Maker directly in your web browser. Since it runs online, there is nothing to download or install.

    Open your existing workspace or create a new one. Make sure your project uses a supported version: NeoForge 26.1.2, NeoForge 1.21.1, Data pack 26.1, Data pack 1.21.1, or Bedrock add-on 26.1.

  2. Add a new Function element

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

    Look in the Logic & code group and select Function.

  3. Choose the Function namespace

    Look for the Function namespace field in the editor.

    You have two options here. Select Mod if the function is used for your mod only. You will call such a function as ${modid}:${registryname}.

    Select Minecraft if the function is used with some Minecraft options. You will call such a function as minecraft:${registryname}.

  4. Set the Function registry name

    Next, fill in the Function registry name field.

    You can write your function name in one word or with several words separated by underscore(s). Good examples are advancement or advancement_biome_reward.

  5. Save your Function

    Double-check that your Function namespace and Function registry name are filled out properly.

    Save your element so your workspace remembers the changes.

  6. Test with Build & run and export

    Click Build & run to test your new Function and make sure your command sets run properly when called.

    When everything works the way you want, export your project to use it in Minecraft.

Tips

Try it in the Studio All function fields explained →