/function Command in Minecraft Bedrock Edition

Run Commands from Behavior Pack Function Files

Bedrock EditionLogic & ScoreboardPermission: Game DirectorsCheats: YesJava version →

The /function command in Minecraft Bedrock Edition runs a list of commands saved inside a corresponding function file. This lets you trigger multiple actions at once with a single line of text.

Map makers and server admins use this command to run complex scripts from an active behavior pack. You must have cheats enabled and hold Game Directors permissions to run it.

Syntax (1 form)

  1. /function <name: filepath>

    Function with file path

Arguments

ArgumentTypeWhat it means
namefilepathRequired. A command file path to a function located in a behavior pack.

Examples

Tips

Common mistakes

Bedrock vs Java

In Minecraft Java Edition, the /function command has extra arguments that let you pass variables directly into the function using /function <name> [<arguments>], or pull data from a block, entity, or storage source using with block, with entity, or with storage.

See /function in Java Edition →

FAQ

Where do function files come from in Bedrock Edition?

Function files are stored inside behavior packs that you install and activate on your Minecraft world.

Do I need cheats enabled to use the /function command?

Yes, cheats must be enabled in your world, and you need the Game Directors permission level to use this command.

Can I pass arguments into a function in Bedrock Edition?

No, Bedrock Edition only accepts the file path argument, whereas passing extra arguments or data sources is only supported in Java Edition.

Related commands

/dialogue/execute/packstack/reload/reloadpacketlimitconfig/schedule/scoreboard/scriptevent/sendshowstoreoffer/tag/testfor/testforblock/testforblocks/toggledownfall

More on 9Minecraft