How to Make Minecraft Bedrock Functions: Run Commands on a Timer

Guides › Logic & scripts

A function is a list of commands that runs all at once, a bit like a saved chain of command blocks. In Bedrock add-ons, functions are the easiest way to add game logic: give items, set scores, play effects or run minigame rules.

The Function editor in Addon's Studio lets you write the commands and choose when they run, with no files or folders to manage. You can then hook functions up to items, blocks and mobs.

Make one now in Addon's Studio

Step by step

  1. Add a Function

    In your project, tap Add item and choose Function. Give it a name.

  2. Write the commands

    Write one command per line, without the /. For example: say Hello from my addon!

  3. Choose when it runs

    Pick Only when used, When a player joins, Every few seconds or Every tick.

  4. Use it from items, blocks and mobs

    Open an item, block or mob, go to its Actions and pick this function for an event.

  5. Run it yourself

    In game, type /function followed by the function's name.

Tips

Questions

What's the difference between a function and a script?

A function is a list of commands. A script is JavaScript using the Script API, which can do more but needs coding. Start with functions.

Do I need cheats on?

To type /function in chat, yes. Functions that the add-on runs on its own, like timed, join or action functions, don't need you to type anything.

Can a function run when a mob dies?

Yes. In the mob's Actions, pick the Dies event and choose your function.

Related guides

ScriptingLogic & scriptsCustom itemItems & toolsCustom menuScreens & cameraCustom mobMobs & players

Try it free

Addon's Studio runs in your browser. No download, no coding.

Start making it