Functions (mcfunction) and command patterns
A function is a .mcfunction file that holds several lines of commands, and it is run in game with the /function command. A function pack is a pack that builds a system from function files alone. Functions cut the time spent going back and forth between command blocks to debug, and make it easier to move a system between worlds. The evidence is the command docs of the Bedrock Wiki (0930b39, provided by the BedrockCommands community), FunctionsIntroduction on MS Learn (a9fd1c0) and community research.
1. File structure
Functions go in the functions/ folder of the behavior pack.
BP/functions/this_code.mcfunction
BP/functions/tick.json
BP/functions/wiki/teleport/zone/hell.mcfunction
Recommended rules (Source: bedrock-wiki):
- Put every
.mcfunctionfile in a namespace root folder underfunctions(BP/functions/wiki/random_number.mcfunctionis good, and putting it directly in the root is bad). - Write folder and file names in snake_case (lowercase, digits, underscores).
- Nest properly (
wiki/teleport/zone/hellis better thanwiki/teleport_hellzone). - Follow the verb-first
action_objectstructure for names (add_all,shuffle_position). - Keep the whole path length at or below 80 characters (console limit).
- Use either singular or plural consistently for content folders.
A function file has one command per line. The slash is omitted, and a line that starts with # is a comment.
# BP/functions/wiki/ability/ice_blast.mcfunction
effect @e[r=5,type=!player] slowness 5 3
particle minecraft:snowflake_particle ~ ~1 ~
playsound random.glass @a ~ ~ ~
tick.json lists the functions to run every tick.
{ "values": [ "wiki/main_loop" ] }
2. How to call
- In game:
/function wiki/ability/ice_blast. - From an entity event: put
function wiki/ability/ice_blastorscriptevent ns:idin thecommandofqueue_command. Entities cannot run/placeand op-only commands, so pass such commands to a script with/scripteventand work around them withplaceFeatureand so on (Source: private research). - From a player controller: detect input such as right click with the state
on_entry: "/function ..."of a BP animation controller and run a function (example transition query:query.is_item_name_any('slot.weapon.mainhand','ns:item') && query.is_using_item). - From scripts: call
source.runCommandwrapped insystem.run(...).dimension.runCommand('... @s')fails because@sbecomes the dimension. On Realms, userunCommandinstead of the removedrunCommandAsync.
3. Commonly used command patterns
- Scoreboard timers, movement detection, player join/death/respawn detection and entity counters are covered by the wiki commands section (mcfunctions, scoreboard-timers, on-player-death and so on).
- Play an animation with
/playanimation @p <anim> <next_state> <blend_out_time> "<stop_expression>" <controller>and set a variable with the stop expression (for exampleplayanimation @s animation.first_person.attack_rotation_item x 900 "v.attack_time=1;"). - Force aggro:
damage @s 0 entity_attack entity <target>(melee only). - Restrict movement:
/inputpermission set <player> movement disabled. Hide the horse health bar:/hud @s hide horse_health(restore with/hud @s reset horse_health). - Give equipment:
replaceitem entity @s slot.armor.feet 1 id,/loot replace entity @s slot.armor.chest 0 loot "...". Item locking is theitem_lockmodelock_in_slot./replaceitem entity @a slot.weapon.mainhand 0 keep airsucceeds only when the hand is empty, so it can detect an empty main hand. A suggested method puts a marker item withkeep, tags the players for whom it succeeded, then removes the marker{unverified}. - There is no official way to increase a player's block placement reach.
- Summon and events:
/summon minecraft:camel_husk ~ ~ ~ ~ ~ minecraft:spawn_with_rider,/summon custom:mob ~~~ minecraft:promote_to_illager_captain,/event entity @s name. /gamerule domobspawning falseturns off natural spawning so custom mobs can be spawned by commands/scripts.- Placing features:
/place feature,/place featureruleand/place jigsaw <pool> <target> <depth> ~~~ truecannot be run from command blocks or functions. Structures are/structure load ns:name, and deleting is/structure delete <name>. - Example of a command condition that checks line of sight:
if block ^ ^ ^0.25 airchecks for obstacles and can be steered with facing teleports. - Several
/event entitycommands in a command block each fire their event. - Block centering is
execute align xz positioned ~0.5 ~0.5 ~0.5 run ..., and dimension travel is/execute in nether run tp <target> ~ ~ ~. The lasttruein/tp @e ^^^+3 truechecks blocks along the path. - If
/fillfails with "world not loaded", the simulation distance is low and the whole fill area is not inside the ticking area. /camera @s fade ...can cover the screen with a solid color. Updating/cameraevery tick looks choppy to players who are not the host, and curved movement is only the spline mode. Usingcamera ... facing @stogether withexecute at @smade the screen flicker in one case (unresolved).- Game rule facts: turning off
dofiretickalso stops fire caused by lightning, and turning offshowtagshides the locked item indicator. A day is 24000 ticks. /spreadplayersmakes a safe random teleport. The result placed by/place feature minecraft:coal_ore_featuresometimes does not show until the world is reopened. Commands alone cannot make particles that look different per player.
4. Case study: drawing damage numbers with particles
An analysis of an add-on that shows hit numbers with scripts + particles, not commands/functions (Source: repo-damage-indicator). That add-on uses no JSON UI at all and consists of a BP script, one RP particle and one PNG. The key techniques are as follows.
- Glyph atlas: a 1024 by 64 PNG with 16 square cells of 64px, and 12 cells for
0~9,-and.drawn as white letters with a black outline. They are drawn in white and the color is applied by tint. The particle UV is"uv": ["variable.glyph * 64", 0],"uv_size": [64, 64], andvariable.glyphpicks the cell. - The script spawns one particle per character with
attacker.spawnParticle("pdi:damage_glyph", pos, vars).Player.spawnParticleis visible only to that player, andDimension.spawnParticleis visible to everyone nearby.
const vars = new MolangVariableMap();
vars.setFloat("variable.glyph", glyph);
vars.setFloat("variable.scale", scale);
vars.setColorRGBA("variable.tint", color);
attacker.spawnParticle("pdi:damage_glyph", pos, vars);
For how to write the particle file and examples of passing variables, see Particles.
setColorRGBA("variable.x", ...)unfolds into four values,variable.x.r/.g/.b/.a. In a tint gradient, if RGB is a variable and only alpha is given as keyframes (0, 1, 1, 0), color and fade can be separated. Translucent isparticles_blendand cutout isparticles_alpha.- Character placement: take
view, the attacker's line of sight normalized onto the XZ plane, computeright = (-view.z, 0, view.x)and shift by 0.155 x(i - (len-1)/2)of spacing. Combined withfacing_camera_mode: lookat_xyzit reads from any angle. For consecutive displays, pick the candidate offset farthest from the most recent 5. - A critical hit is a heuristic estimated as
isFalling, not in water, swimming or climbing, and without blindness or slow falling. Only melee and mace smash attacks are shown. Indicators attached to the world (numbers above heads and so on) must be made with particles or entities, not JSON UI.
5. Function rule details (merged from community research packs-versions)
- Line endings are LF (not CRLF) and commands do not start with
/. If you break this, the function silently does not appear. Making it with bridge. or copying an existing function avoids this.{community confirmed} - A report says that if the BP manifest/format is above 1.17.0,
#comments do not work, which disagrees with the comment example in section 1{conflict}. A function that failed to load does not appear in the list, so if a function is missing, try removing its comments. Unexpected @a / @eerrors orexecuteparse failures happen because the manifest is parsed with the syntax from before 1.19.50. Fix it with"format_version": 2+"min_engine_version": [1,19,50]or higher, or use the old syntax. Conversion:execute @a ~ ~ ~ <cmd>=execute as @a at @s positioned ~ ~ ~ run <cmd>,detect ~ ~ ~ air=if block ~ ~ ~ air.tick.jsongoes infunctions/and lists the functions to run every tick. The tick.json functions of several add-ons run at the same time. A recommended setup is onemain.mcfunctionthat conditionally calls other functions with score holder flags (execute if score map_1 wiki:q.is_active matches 1 run function maps/map_1/on). Reports differ on the performance of tick.json vs an entityenvironment_sensorrunner. Polling with tick.json is slower than event-based scripts.- There are no conditional chains, so use
execute if/unlessor scoreboards instead./schedulecan be used inside functions and/schedule on_area_loadedwaits for chunk loading. However, in one case/schedule delay add <function> 60inside an mcfunction called from a tick function did not run while the same command worked in a command block (cause unconfirmed, 2026-11). A function scheduled with/schedule delay addloses the executor context, so@spoints to no one. Tag the player before scheduling and pick the target by tag inside the function, like@a[tag=book]. - Calling a function from a script is
player.runCommand('function name'). A function containing a command that scripts do not allow (/place) does not run even when started from a script./opand/connectfail in the script engine. - Command strings in NPC/dialogue JSON escape inner quotes:
"on_open_commands": ["/tellraw @a {\"rawtext\":[{\"text\":\"hi\"}]}"]. In 2026-01 there was a report that theselector@initiator/scorerawtext in NPC dialogue text does not work. The cause of an item-use trigger function failing silently was wrongexecutesyntax. - Permission level: functions are parsed at permission level 1 and
/placeis level 2, so/place(jigsaw, feature) cannot be run from command blocks, functions or tick.json. Work around it withrunCommandin a script./reloadis also not possible from command blocks/functions/NPCs. There is a mention that an NPC can be opened with/dialogueand runs commands with elevated permission.{single report} - A function inherits the caller's execution context. Called from chat, it has the player's position/rotation/executor. From a command block, it has the block position with no executor (
@sis not defined untilexecute as). In tick.json it runs at 0,0,0, so position selectors (y=0,dy=-600) are silently checked relative to 0,0,0. Fix example:execute in the_end as @a[rm=0] at @s if entity @s[tag=eternal,y=0,dy=-600] run function eternal_void(inchanges only the dimension of the following subcommands, so filter per dimension withas @a[rm=0]orr=999999999).{community confirmed} - Selectors:
r/rmare relative to the entity's feet position, and the volumex,y,z,dx,dy,dzis a hitbox contact check (when sneaking the hitbox gets smaller, so sneaking can be detected). A volume selector accepts~relative coordinates and is at least 1x1x1. Ring check:execute as @a at @s if entity @e[type=!player,r=6,rm=5], andrm=0.001(or 0.01) excludes yourself. To pick players within a radius around x=0, z=0 regardless of height, set the execution Y to each player's Y:execute as @a positioned as @s positioned 0 ~ 0 run effect @s[r=20] regeneration 10 0 true. For a box area usex,z,dx,dz. - Checkerboard grid: paint with four commands that fork execution at a 2-block spacing with 2x2 offsets (two black and two white fills), then overwrite the edges.
- For timers, scoreboard timers are recommended over chain delays or redstone.
^^^intpis relative to the execution position, so to move each target useexecute as <targets> at @s run tp @s ^.../execute facingrotates before the teleport andtp ... facingrotates after. 10 blocks backward isexecute as @a at @s rotated ~ 0 run tp @s ^^^-10. Block comparison isexecute if blocks <ref> <ref> <target> all|masked(allincludes air,maskedignores it), the offset is relative to the destination corner, and since it also compares signed books and names it can be unstable. Waterlogging cannot be checked with block states. - There is a consensus that custom commands (
namespace:name, callable without the namespace if the name is unique) are preferable./scripteventdoes not consume a command name, is hidden from users and changes without a reload, so it suits calls inside a pack and between packs, but users can run it, so deop or permission limits are needed. Custom commands work on Realms (more portable than betachatSend) and can be run withrunCommand, but the result text is not returned. Running a custom command closes the chat window, so it is good for showing a form right after. - Permission level of custom commands: for a command that is used in command blocks but needs op in chat (for example
/effect), give a lower permission level. The reference is in Bedrock Wiki custom-commands. A report that a script custom command did not run from a command block is unresolved.
6. Summary for scripting and tooling (merged from scripting / tooling-server)
- Before events, command callbacks and startup are restricted (early) execution, so
runCommand,setItem,spawnParticle,addTag, formshowand so on fail withNative function [...] cannot be used in restricted execution. Wrap them insystem.run(() => ...).runCommandAsyncwas removed in the 2.x migration, so userunCommand. system.afterEvents.scriptEventReceive(not world) gives{id, message, sourceType, initiator, sourceEntity, sourceBlock}, andScriptEventSourceis Block, Entity, NPCDialogue or Server. Send with/scriptevent ns:id msgorsystem.sendScriptEvent(id, message). Entity JSONqueue_commandsends a signal to scripts. Communication between add-ons (IPC) all use scriptevent as the transport (MCBE-IPC is effectively the standard).- Blocks have no
runCommand, so useblock.dimension.runCommand("execute positioned x y z run function ...")(/setblock ... destroydrops items, andblock.below().setType("minecraft:air")does not). There is noplayer.kickAPI, so usekick @s "reason"withrunCommandinsidesystem.run.Player.stopSoundis beta, and the stable way isrunCommand("stopsound ..."). - Writing mob equipment is
entity.runCommand("replaceitem entity @s slot.armor.head 0 diamond_helmet")(the RP entity needs"enable_attachables": true), and reading istestfor @s[hasitem={item=...}]. Structure loading is asynchronous so a fixed tick wait is needed, and a large structure (96x96) can crash the native call, so split it into jigsaw pieces.dimension.placeFeature(feature, location, true)andDimension.placeFeatureRule()are expensive in bulk. Entities cannot run/place, so request it from a script with/scriptevent. /connector/wsserver host:portis a command the client runs, so it cannot be run with a script'srunCommandandsuccessCountis always 0. WebSocket/HTTP are not possible in scripts. server-net/server-admin are BDS only. With the late 2026-11 builds the/connectconnection shows a warning and drops when the player leaves the world. It is not in any changelog and was reported as MCPE-244691{single report}.- Tools: bridge. (web editor) supports generating mcfunction, the VS Code extension MCBE Command Checker validates mcfunction, and
MCDevKit.jsonte-vscodesupports injection inside .mcfunction. Long/executechains are of limited use in Bedrock with scripting. AI answers are hard to trust for Bedrock commands and the Script API. - Multiplayer sync: continuously using
tpon many entities looks like lag for players who are not the host. Selectors and forks grow with the number of players, so command cost rises. - BP animation controllers are trigger-based so they are cheap, while scripts have a higher ceiling and are easier to combine. Running a function on right click is also possible with the player.json controller (when
query.is_using_item && query.is_item_name_any('slot.weapon.mainhand', 'ns:item')is true, run/functioninon_entry).
Molang usage rules
- Molang short-circuits left to right. Putting a check first, as in
!q.is_in_ui && ..., avoids the "called on an entity with no actor" error. Write boolean queries asq.is_sprintingand!q.is_sprintinginstead ofq.is_sprinting == true. q.scoreboardcan be used only in a BP, andq.is_local_playeronly in an RP.math.clamp(value, min, max)takes 3 arguments. Instead of assigning inside a ternary, useq.in_range(v, lo, hi).- An RP alone cannot get the distance between players.
7. Commands registered in the client (Windows 1.26.65.1)
This compares the command registration function in the client code and in-game execution results with the official mojang-commands.json (1.26.50.4). The in-game runs were done in a creative world with cheats on, and responses were read from the message keys of CommandOutput packets. In a cheats-off world only a few commands were tried separately (7.2).
7.1 Permission and flags
The registration function takes a command name, a description key, a permission byte and two 16-bit flags. The two flags are ORed into the 16-bit value of the command record {code}.
- The
0x80bit of the flags means no cheats are required. Among the 74 commands whose names were resolved and that are inmojang-commands.json,requires_cheatsmatched "this bit is off" in all 74. The permission bytes of the same 74 also all matchedpermission_level, so the numbers 0 to 4 follow the same scheme as the official documentation (0 ishelp,list,me,tell,packstack; 2 isop,deop,permission,place,reload,script,wsserver; 3 issetmaxplayers; 4 is theallowlistfamily,stop,transfer; most of the rest are 1){code}. gameruleis permission 1 with0x80. The stringcommands.gamerule.type.nocheatsenabledexists, so the command appears to open without cheats and block per rule whether cheats are needed{code, inferred}.- Command enum values must be lower case. A keyword that is not registered is rejected with
Keywords in commands need to be lower case. '%s' was not registered.{code}. - The path that receives the command list the server sends (AvailableCommands) and registers it uses the same registration function and passes the permission and flags as they are in the packet entry. This means the client-side flags are decided by the server and interpreted the same way
{code}.
| Flag | Commands | Meaning |
|---|---|---|
0x80 | gamerule, list, packstack, kick, project, party, tell, tellraw, me, say, op, deop, permission, help | matches "usable without cheats" for the commands in the official JSON. party is not in the official JSON, and that it can be used in a cheats-off world was not confirmed (7.2) |
0x40 | tell, tellraw, me, say, title, titleraw | appears to be a group of chat-message-style commands. Only the common point was confirmed {inferred} |
0x10 | help | appears to be handled locally {inferred} |
0x20 | script, wsserver | only the common point (debugger and websocket family) was confirmed {inferred} |
0x400 | op, deop, permission | if an editor object exists and this bit is on, it goes to the error commands.generic.disabled.editorLocked |
0x2, 0x4, 0x8 | the 0x6 commands in the 7.2 table below, lesson (0x4), codebuilder (0x4) | "blocked" bits per command origin kind. If the bit is on in the command record and the origin is of that kind, the command is refused with commands.generic.error.permissions whatever the permission level. Player is 0x4, command block and command block minecart is 0x2, automation player family is 0x8. What the code confirms is the kind numbers (0 is 0x4, 1 and 2 are 0x2, 5 and 6 are 0x8); the kind names are {inferred} {code}. The same bit also removes the command for that origin from the autocomplete name list and the /help list |
The check just before execution goes in this order {code}. If the origin's permission level is lower than the command's permission, it is refused. If the permission is enough, the origin kind is turned into a bit above and the command flags are checked for that bit. If it is on, the command is refused; if it is off, it runs. Kinds 3, 4 and 7 and above have no bit and skip this check. The refusal text on an ordinary client is always commands.generic.error.permissions; only a player with an education block list can get commands.generic.blocked_edu. Syntax parsing comes before this check, so /gettopsolidblock without arguments gives commands.generic.syntax. If a global boolean is true at registration time, all three bits are cleared and the command works from any origin {code}. This boolean reads as the debug feature toggle dev_expose_hidden_commands (display text "Expose all hidden commands (requires level restart)"). The pairing of toggle number 4 with that name was read from the call argument order, so it is {inferred}, and the path that turns the toggle on and whether it is saved were not confirmed.
The same bits are used by autocomplete and /help. The autocomplete name list and the /help list call the same decision function, and drop a command if the permission level is too low or the origin-kind bit (0x2, 0x4, 0x8) is on in the command flags {code}. The lists walk the client-local command registration map, and entries from a server AvailableCommands packet go into the same map. So a 0x6 command is not shown to player chat and command block origins, and is shown to automation origins (which lack 0x8).
Of the 25 unofficial commands, 16 are hidden by flags for a player origin: the 14 with 0x6 (gettopsolidblock, querytarget, listd, closechat, getlocalplayername, geteduclientinfo, closewebsocket, enableencryption, getchunkdata, getchunks, getspawnpoint, globalpause, codebuilder_actorinfo, agent) and the 2 with 0x4 (lesson, codebuilder). The other 9 (ability, immutableworld, takepicture, resourceuri, worldbuilder, classroommode, code, gametips, party) are not hidden by flags and show only if they pass the registration condition and the permission level. No unofficial command has 0x8 {code}.
7.2 25 registered commands that are not in the official JSON
25 registered commands have names that are not in mojang-commands.json (the name of party was resolved from a data area; the second registration of codebuilder is a separate name, codebuilder_actorinfo). The classification below is based on permission, flags and the commands.*.description of the vanilla en_US.lang. Whether a command is education-only is {inferred} from which branch its registration sits in (the condition itself was not read).
| Name | Permission | Flags | Description (vanilla lang) | Classification |
|---|---|---|---|---|
ability | 1 | 0 | Sets a player's ability. | education-conditional, needs cheats |
immutableworld | 1 | 0 | Sets the immutable state of the world. | education-conditional |
takepicture | 1 | 0 | no lang entry | education-conditional |
resourceuri | 1 | 0 | no lang entry | conditional (by name, a resource address lookup) |
worldbuilder | 1 | 0 | Toggle World Builder status of caller. | education-conditional |
classroommode | 0 | 0 | Attempt to launch and connect to Classroom Mode. | education, client feature |
code | 0 | 0 | Launches Code Builder. | education, client feature |
gametips | 0 | 0 | Enable or disable the game tips on this device | client setting |
party | 0 | 0x80 | Sends a message in the party chat | registered behind a client condition (party service). Absent from a single-player world in the measurement below |
lesson | 1 | 0x4 | Handle Educational Lesson reporting. | for education reporting, players only |
codebuilder | 1 | 0x4 | no lang entry | education automation |
codebuilder_actorinfo | 0 | 0x6 | no lang entry (description key commands.codebuilder.description) | education automation. The name of the second codebuilder registration |
agent | 1 | 0x6 | no lang entry | education automation |
closechat | 0 | 0x6 | Closes the chat window of the local player if it is open. | automation, client |
getlocalplayername | 0 | 0x6 | Returns the local player name. | automation |
geteduclientinfo | 0 | 0x6 | no lang entry | education automation |
closewebsocket | 0 | 0x6 | Closes websocket connection if there is one. | websocket automation |
enableencryption | 0 | 0x6 | no lang entry | websocket automation |
getchunkdata | 3 | 0x6 | Gets pixels for a specific chunk. | automation, map |
getchunks | 3 | 0x6 | Gets list of chunks that are loaded. | automation, map |
getspawnpoint | 3 | 0x6 | Gets the spawn position of the specified player(s). | automation |
globalpause | 3 | 0x6 | Sets or gets the paused state of the game for all players. | automation, education |
gettopsolidblock | runtime value | 0x6 | Gets the position of the top non-air block below the specified position | automation |
querytarget | runtime value | 0x6 | Gets transform, name, and id information about the given target entity or entities. | automation |
listd | 3 | 0x6 | no lang entry | the detailed version of list. The success key is the same, commands.players.list |
There is no separate "editor only" command; the editor lock is expressed by the 0x400 bit (op, deop, permission). The only ones that can be seen as development and test only are the 0x20 bit commands (script, wsserver) and gametest, and all of them are in the official JSON.
The measurements in an ordinary creative world with cheats on are as follows {measured}.
- The command list the server sent had
gettopsolidblock,querytarget,listdandagent. The other commands in the table above (closechat,closewebsocket,enableencryption,getchunkdata,getchunks,getspawnpoint,resourceuri,takepicture,ability,codebuilder,lesson,classroommode,worldbuilder,immutableworld) were absent from the names, and running them gavecommands.generic.unknown. In this world they are not registered or are hidden.geteduclientinfo,getlocalplayername,gametipsandglobalpausecould not be told apart by the response (they were not in the list; the follow-up measurement below tells them apart). /gettopsolidblockgavecommands.generic.syntax, and/gettopsolidblock ~ ~ ~gavecommands.generic.error.permissions./querytarget @sand/listdalso gavecommands.generic.error.permissions. The three exist as commands and are refused in player chat in this world. The reason is not the permission level but the0x4bit (player origin blocked) of flag0x6. Raising the host permission level does not unblock them in player chat{code}. Their output could not be measured because of the refusal./agentgavecommands.generic.syntax(a syntax hint).- Among commands with flag
0x6, some were in the list and some were not. This flag is read in the check just before execution and in the autocomplete and/helplist decision, but no place that blocks the server's list transmission or the AvailableCommands receipt was found in the code. Whether a command appears seems to be decided by the server-side registration{code, inferred}. - The origins that can actually run
gettopsolidblock,querytargetandlistdare presumed to be those other than player (0x4) and command block (0x2), that is, automation origins such as a websocket connection. The origin kind names and this assumption were not measured{inferred}. - Follow-up measurement (cheats-on world, player chat, Windows 1.26.65.1, 2026-11-20):
/party hellosent a packet and the server answeredcommands.generic.unknown(parameter["party"])./gametips enableand/gametips disablewere handled by the client without a packet, printedGame tips enabledandGame tips disabledin chat (the game's localized text) and changed the optiongame_tips_enabledto 1 and 0. With no argument ormaybeit is a local syntax error./getlocalplayername,/geteduclientinfo,/closechatand/closewebsocketgave a permission-level error with no packet (consistent with the0x4block), also with cheats on./enableencryptionwithout arguments gave a local syntax error, so the local registration is confirmed, and a run with arguments was not done. The rest (getchunks,getchunkdata,getspawnpoint,globalpause,ability,takepicture,resourceuri,immutableworld,lesson,codebuilder,classroommode,code,worldbuilder,wb) gotcommands.generic.unknownfrom the server./agentgavecommands.generic.syntax, so it exists on the server{measured}. The earlier "registered behind a client condition (party service)" is a code reading, and whypartyis absent on the server in this session (the registration condition) was not separated.
The results typed into chat in a cheats-off single-player world (Windows 1.26.65.1) are as follows {measured}.
/party hellosent noCommandRequestpacket and gave only the local message "Cheats cannot be used in this world." (the game's localized text). It is the same result as the nonexistent command/zzzfoo, and in autocomplete/poffered onlypackstack,permission,deop,helpandop. In this worldpartyis not registered or is hidden. Permission 0 and flag0x80alone do not mean it can be used. This matches the code reading that its registration sits behind a party service condition{code}./listd,/gametips,/querytarget @s,/gettopsolidblock ~ ~ ~,/agent,/getchunks,/getlocalplayername,/closechat,/closewebsocketand/ability @s mayfly truealso all gave the same local message with no packet. Typing/listdto the end in the input line showed no autocomplete entry. In this world they are not visible and cannot be used.- As a control,
/listsent a packet and returnedcommands.players.list(parameters["1","8"]) and the name list. - With cheats off,
listdwas refused and absent from autocomplete in a case where both the permission level (signature permission 3) and the0x4of flag0x6hide it, so this measurement cannot separate the two. With cheats on and enough permission, it should still not appear in player chat autocomplete because of0x4{code}(not measured). The statement thatlistdis visible in game withop-permission-level=4is a remote server condition and was not confirmed by this measurement.
7.3 Syntax of the commands not in the official JSON
This pairs the overload registration calls, argument names and argument type objects read from the client's registration functions. When there are two or more arguments, the order and which are optional were not settled. Dumping the AvailableCommands packet the server sends would settle them {code}.
| Command | Syntax |
|---|---|
gettopsolidblock | <position: x y z>. Output keys position, blockName. Errors commands.gettopsolidblock.notfound, commands.generic.invalidcontext |
querytarget | <target: target>. Per target it outputs uniqueId, id, yRot, position, dimension, details. Success key commands.querytarget.success, no target commands.generic.noTargetMatch |
listd | [details: ListDetails]. ListDetails is ids, uuids, stats. Output keys currentPlayerCount, maxPlayerCount, players, details |
party | <message: message>. It sends only when the party service is on and there is a party. Otherwise parties.chat.command.unavailable, and an empty message gives commands.generic.invalidMessage |
gametips | <status: enable or disable>. Success keys commands.gametips.enabled, commands.gametips.disabled |
closechat, geteduclientinfo, getlocalplayername, closewebsocket, classroommode, code | no arguments |
worldbuilder | no arguments. Alias wb |
immutableworld | <value: Boolean> |
getspawnpoint | <player: target> |
getchunks | 1 argument (appears to be a dimension type) |
getchunkdata | 4 arguments: dimension, chunkX, chunkZ, height |
globalpause | [isPaused: Boolean] |
ability | <player: target> <ability: Ability> [value: Boolean] as two overloads (order and the Ability values unconfirmed) |
takepicture | 3 overloads: targetPlayer and targetCamera (actor selector), targetPlayer and cameraSpawnLocation (position), targetPlayer |
resourceuri | 4 overloads: no arguments, clear, default <uri>, named <name> <uri> |
enableencryption | 3 arguments: publicKey, salt, and the cipher mode (the argument name is misspelled ciper_mode; values cfb8, cfb128 and others) |
lesson, codebuilder | several enums and a player selector. lesson has 4 overloads. The details were not resolved |
codebuilder_actorinfo | CodeBuilderActionInventory and the actor selector target |
agent | a group of subcommands (move, turn, destroy, place, collect, transfer, teleport and others). The argument names srcSlotNum, dstSlotNum, quantity, item, position, y-rot and lookAtPosition appear |
7.4 Names that are not separate commands
spawnParticleEmitter, screenshake and transferserver are not separate commands but description key names of particle, camerashake and transfer. Resolving the name values of the registration functions gives particle, camerashake and transfer, and only the description keys are commands.spawnParticleEmitter.description, commands.screenshake.description and commands.transferserver.description {code}. So commands.spawnParticleEmitter.description=Creates a particle emitter in the vanilla lang is the description of the particle command. The permissions are particle 1, camerashake 1 and transfer 4, the same as the official JSON.
In the measurement, /spawnParticleEmitter, /screenshake and /transferserver all gave commands.generic.unknown. The success key of /particle minecraft:villager_happy ~ ~2 ~ was commands.spawnParticleEmitter.success, and that of /camerashake add @s 1 2 was commands.screenshake.success. /transfer KimPresent 127.0.0.1 19999 was refused with commands.generic.error.permissions and the player did not leave the world. The arguments of transfer are owner, server and port (an integer, optional), and a wrong syntax gives commands.generic.syntax {measured}.
7.5 Game rules
The client's gamerule registration creates three enums: BoolGameRule, IntGameRule and FloatGameRule. The official JSON has no FloatGameRule (only BoolGameRule, IntGameRule, playerwaypointsRule and playerwaypointsValues). The game rule registry creates 39 rules. There is no float rule at all and only the value read and write code is implemented, so FloatGameRule reads as an empty enum (probably no entries in autocomplete, not measured {inferred}). All 38 names of the official JSON (1.26.50.4) are present, and the only rule not in the JSON is locatorbar. locatorbar is the key name of old saves. When world data is read, this key is converted into the initial value of playerWaypoints (1 if the key is missing or true, 0 if false). Whether locatorbar appears in /gamerule autocomplete is likely yes, since the enum registration code does not seem to leave this rule out, but this was not measured {code, inferred}.
This is the rule order, name, type, default and cheats requirement read from the client registry. The names are the registry spelling and are exposed in lower case in the command (this matches the check that enum values must be lower case {code, inferred}). A rule marked "required" under cheats is blocked by /gamerule with commands.gamerule.type.nocheatsenabled in a world with cheats off {code}.
| No. | Name | Type | Default | Cheats |
|---|---|---|---|---|
| 0 | commandBlockOutput | boolean | true | required |
| 1 | doDayLightCycle | boolean | true | required |
| 2 | doEntityDrops | boolean | true | required |
| 3 | doFireTick | boolean | true | not required |
| 4 | recipesUnlock | boolean | true | not required |
| 5 | doLimitedCrafting | boolean | false | not required |
| 6 | doMobLoot | boolean | true | not required |
| 7 | doMobSpawning | boolean | true | required |
| 8 | doTileDrops | boolean | true | not required |
| 9 | doWeatherCycle | boolean | true | required |
| 10 | drowningDamage | boolean | true | required |
| 11 | fallDamage | boolean | true | required |
| 12 | fireDamage | boolean | true | required |
| 13 | keepInventory | boolean | false | required |
| 14 | mobGriefing | boolean | true | required |
| 15 | pvp | boolean | true | not required |
| 16 | showCoordinates | boolean | false | not required |
| 17 | playerWaypoints | integer (enum playerwaypointsRule, values everyone, off) | 1 | not required |
| 18 | locatorbar | boolean | true | not required |
| 19 | showDaysPlayed | boolean | false | not required |
| 20 | naturalRegeneration | boolean | true | not required |
| 21 | tntExplodes | boolean | true | not required |
| 22 | sendCommandFeedback | boolean | true | required |
| 23 | maxCommandChainLength | integer | 65535 | required |
| 24 | doInsomnia | boolean | true | required |
| 25 | commandBlocksEnabled | boolean | true | required |
| 26 | randomTickSpeed | integer | 1 | required |
| 27 | doImmediateRespawn | boolean | false | not required |
| 28 | showDeathMessages | boolean | true | not required |
| 29 | functionCommandLimit | integer | 10000 | required |
| 30 | spawnRadius | integer | 10 | not required |
| 31 | showTags | boolean | true | not required |
| 32 | freezeDamage | boolean | true | required |
| 33 | respawnBlocksExplode | boolean | true | not required |
| 34 | showBorderEffect | boolean | true | required |
| 35 | showRecipeMessages | boolean | true | not required |
| 36 | playersSleepingPercentage | integer | 100 | not required |
| 37 | projectilesCanBreakBlocks | boolean | true | not required |
| 38 | tntExplosionDropDecay | boolean | false | not required |
There are 33 booleans (including locatorbar) and 6 integers (including playerWaypoints) {code}. In the registry entries, only locatorbar has 0 in the byte that looks like an "active marker", and the meaning of that byte is unknown. The /gamerule executor has a branch that handles rule number 43 separately, but the registry size is 39, so that number is not in this array. Whether the branch is dead was not read.
The enums in the official JSON (1.26.50.4) are as follows {vanilla}.
- 32
BoolGameRule:commandblockoutput,dodaylightcycle,doentitydrops,dofiretick,recipesunlock,dolimitedcrafting,domobloot,domobspawning,dotiledrops,doweathercycle,drowningdamage,falldamage,firedamage,keepinventory,mobgriefing,pvp,showcoordinates,showdaysplayed,naturalregeneration,tntexplodes,sendcommandfeedback,doinsomnia,commandblocksenabled,doimmediaterespawn,showdeathmessages,showtags,freezedamage,respawnblocksexplode,showbordereffect,showrecipemessages,projectilescanbreakblocks,tntexplosiondropdecay. - 5
IntGameRule:maxcommandchainlength,randomtickspeed,functioncommandlimit,spawnradius,playerssleepingpercentage. - The locator bar rule is a separate enum,
playerwaypointsRuleandplayerwaypointsValues.
8. Full reference
The command list and introduction documents are included as MS Learn original excerpts in the command list.
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
private-research | Private research (-) | - | 2026-11-13 | |
bedrock-wiki | Bedrock Wiki | CC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository) | 0930b39 | 2026-11-13 |
ms-learn | Minecraft Creator documentation (Microsoft Learn) | CC BY 4.0 (documentation), MIT (code) | a9fd1c0 | 2026-11-13 |
repo-damage-indicator | Premium Damage Indicator analysis (this repository) (damage-indicator/) | This project's material (the analyzed add-on is third-party work; facts only, rewritten) | 2026-11-13 |