/function Command Generator
BetaType the function and, on Java 1.20.2+, the arguments its $ macro lines read. The preview shows the function file and where it lives in the pack.
Describe it — AI writes the command
Type what you want in plain words. The AI fills the form below, so you can see it and change anything. It follows the edition and version you picked.
Checking the AI…
Paste a command— edit it here or move it to another version
Your command · Java 26.3
57 characters/function my_pack:give_kit {item:"diamond_sword",count:1}
- Inside the function, lines starting with $ use the arguments as $(name).
Raw editor
How it works
A function is a .mcfunction file of commands that run in order, in one tick.
Java 1.20.2 and later: macro arguments
function my_pack:give_kit {item:"diamond_sword",count:1}
function my_pack:give_kit with storage my_pack:settings
function my_pack:give_kit with entity @s SelectedItemLines starting with $ in the function get $(item) replaced with the argument.
Java 1.13 – 1.20.1
function my_pack:start function #my_pack:load
Function tags (#) run every function in the tag. Java 1.12 has functions but no tags.
Bedrock
function my_pack/start
The path inside the behaviour pack's functions/ folder — no namespace, tags or arguments.
FAQ
Where do I put a function file?
Java: data/<namespace>/function/<path>.mcfunction in a data pack (functions/ before 1.21). Bedrock: functions/<path>.mcfunction in a behaviour pack.
What are macro functions?
From Java 1.20.2 a function line starting with $ can use $(name); you pass the values inline as a compound or with storage / entity / block data.
Why does my function say 'Unknown function'?
The pack isn't loaded, the path is wrong, or a command in the file has an error (Java skips the whole function). Run /reload and check the log.
Can a function tag take arguments?
No — only a single function takes macro arguments.
Do Bedrock functions use namespaces?
No. Write the folder path, like my_pack/start for functions/my_pack/start.mcfunction.