How to Make a Function

Section

What is a function

Functions allow players to run lists of commands using text files with the extension .mcfunction.

Settings and Configuration

Naming

You can write your function name in one word or with several words with underscore(s).

Examples:

  • advancement
  • advancement_biome_reward

Namespace

Mod: Is used for your mod only. (Display like your_mod_id:function_name)

Minecraft: Is used with some Minecraft options (Display like minecraft:function_name)

Commands

Write all commands you want in the code section. You don't have to write the "/" before commands. You can only write one command per line. If you write more than one, it will not work, and you will have an error. You can only use Vanilla commands, otherwise, with custom commands, your function won't work.



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.