Skip to main content

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):

  1. Put every .mcfunction file in a namespace root folder under functions (BP/functions/wiki/random_number.mcfunction is good, and putting it directly in the root is bad).
  2. Write folder and file names in snake_case (lowercase, digits, underscores).
  3. Nest properly (wiki/teleport/zone/hell is better than wiki/teleport_hellzone).
  4. Follow the verb-first action_object structure for names (add_all, shuffle_position).
  5. Keep the whole path length at or below 80 characters (console limit).
  6. 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_blast or scriptevent ns:id in the command of queue_command. Entities cannot run /place and op-only commands, so pass such commands to a script with /scriptevent and work around them with placeFeature and 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.runCommand wrapped in system.run(...). dimension.runCommand('... @s') fails because @s becomes the dimension. On Realms, use runCommand instead of the removed runCommandAsync.

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 example playanimation @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 the item_lock mode lock_in_slot. /replaceitem entity @a slot.weapon.mainhand 0 keep air succeeds only when the hand is empty, so it can detect an empty main hand. A suggested method puts a marker item with keep, 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 false turns off natural spawning so custom mobs can be spawned by commands/scripts.
  • Placing features: /place feature, /place featurerule and /place jigsaw <pool> <target> <depth> ~~~ true cannot 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 air checks for obstacles and can be steered with facing teleports.
  • Several /event entity commands 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 last true in /tp @e ^^^+3 true checks blocks along the path.
  • If /fill fails 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 /camera every tick looks choppy to players who are not the host, and curved movement is only the spline mode. Using camera ... facing @s together with execute at @s made the screen flicker in one case (unresolved).
  • Game rule facts: turning off dofiretick also stops fire caused by lightning, and turning off showtags hides the locked item indicator. A day is 24000 ticks.
  • /spreadplayers makes a safe random teleport. The result placed by /place feature minecraft:coal_ore_feature sometimes 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], and variable.glyph picks the cell.
  • The script spawns one particle per character with attacker.spawnParticle("pdi:damage_glyph", pos, vars). Player.spawnParticle is visible only to that player, and Dimension.spawnParticle is 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 is particles_blend and cutout is particles_alpha.
  • Character placement: take view, the attacker's line of sight normalized onto the XZ plane, compute right = (-view.z, 0, view.x) and shift by 0.155 x (i - (len-1)/2) of spacing. Combined with facing_camera_mode: lookat_xyz it 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 / @e errors or execute parse 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.json goes in functions/ 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 one main.mcfunction that 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 entity environment_sensor runner. Polling with tick.json is slower than event-based scripts.
  • There are no conditional chains, so use execute if/unless or scoreboards instead. /schedule can be used inside functions and /schedule on_area_loaded waits for chunk loading. However, in one case /schedule delay add <function> 60 inside 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 add loses the executor context, so @s points 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. /op and /connect fail 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 the selector @initiator/score rawtext in NPC dialogue text does not work. The cause of an item-use trigger function failing silently was wrong execute syntax.
  • Permission level: functions are parsed at permission level 1 and /place is level 2, so /place (jigsaw, feature) cannot be run from command blocks, functions or tick.json. Work around it with runCommand in a script. /reload is also not possible from command blocks/functions/NPCs. There is a mention that an NPC can be opened with /dialogue and 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 (@s is not defined until execute 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 (in changes only the dimension of the following subcommands, so filter per dimension with as @a[rm=0] or r=999999999). {community confirmed}
  • Selectors: r/rm are relative to the entity's feet position, and the volume x,y,z,dx,dy,dz is 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], and rm=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 use x,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. ^^^ in tp is relative to the execution position, so to move each target use execute as <targets> at @s run tp @s ^... /execute facing rotates before the teleport and tp ... facing rotates after. 10 blocks backward is execute as @a at @s rotated ~ 0 run tp @s ^^^-10. Block comparison is execute if blocks <ref> <ref> <target> all|masked (all includes air, masked ignores 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. /scriptevent does 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 beta chatSend) and can be run with runCommand, 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, form show and so on fail with Native function [...] cannot be used in restricted execution. Wrap them in system.run(() => ...). runCommandAsync was removed in the 2.x migration, so use runCommand.
  • system.afterEvents.scriptEventReceive (not world) gives {id, message, sourceType, initiator, sourceEntity, sourceBlock}, and ScriptEventSource is Block, Entity, NPCDialogue or Server. Send with /scriptevent ns:id msg or system.sendScriptEvent(id, message). Entity JSON queue_command sends 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 use block.dimension.runCommand("execute positioned x y z run function ...") (/setblock ... destroy drops items, and block.below().setType("minecraft:air") does not). There is no player.kick API, so use kick @s "reason" with runCommand inside system.run. Player.stopSound is beta, and the stable way is runCommand("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 is testfor @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) and Dimension.placeFeatureRule() are expensive in bulk. Entities cannot run /place, so request it from a script with /scriptevent.
  • /connect or /wsserver host:port is a command the client runs, so it cannot be run with a script's runCommand and successCount is always 0. WebSocket/HTTP are not possible in scripts. server-net/server-admin are BDS only. With the late 2026-11 builds the /connect connection 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-vscode supports injection inside .mcfunction. Long /execute chains 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 tp on 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 /function in on_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 as q.is_sprinting and !q.is_sprinting instead of q.is_sprinting == true.
  • q.scoreboard can be used only in a BP, and q.is_local_player only in an RP.
  • math.clamp(value, min, max) takes 3 arguments. Instead of assigning inside a ternary, use q.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 0x80 bit of the flags means no cheats are required. Among the 74 commands whose names were resolved and that are in mojang-commands.json, requires_cheats matched "this bit is off" in all 74. The permission bytes of the same 74 also all matched permission_level, so the numbers 0 to 4 follow the same scheme as the official documentation (0 is help, list, me, tell, packstack; 2 is op, deop, permission, place, reload, script, wsserver; 3 is setmaxplayers; 4 is the allowlist family, stop, transfer; most of the rest are 1) {code}.
  • gamerule is permission 1 with 0x80. The string commands.gamerule.type.nocheatsenabled exists, 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}.
FlagCommandsMeaning
0x80gamerule, list, packstack, kick, project, party, tell, tellraw, me, say, op, deop, permission, helpmatches "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)
0x40tell, tellraw, me, say, title, titlerawappears to be a group of chat-message-style commands. Only the common point was confirmed {inferred}
0x10helpappears to be handled locally {inferred}
0x20script, wsserveronly the common point (debugger and websocket family) was confirmed {inferred}
0x400op, deop, permissionif an editor object exists and this bit is on, it goes to the error commands.generic.disabled.editorLocked
0x2, 0x4, 0x8the 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).

NamePermissionFlagsDescription (vanilla lang)Classification
ability10Sets a player's ability.education-conditional, needs cheats
immutableworld10Sets the immutable state of the world.education-conditional
takepicture10no lang entryeducation-conditional
resourceuri10no lang entryconditional (by name, a resource address lookup)
worldbuilder10Toggle World Builder status of caller.education-conditional
classroommode00Attempt to launch and connect to Classroom Mode.education, client feature
code00Launches Code Builder.education, client feature
gametips00Enable or disable the game tips on this deviceclient setting
party00x80Sends a message in the party chatregistered behind a client condition (party service). Absent from a single-player world in the measurement below
lesson10x4Handle Educational Lesson reporting.for education reporting, players only
codebuilder10x4no lang entryeducation automation
codebuilder_actorinfo00x6no lang entry (description key commands.codebuilder.description)education automation. The name of the second codebuilder registration
agent10x6no lang entryeducation automation
closechat00x6Closes the chat window of the local player if it is open.automation, client
getlocalplayername00x6Returns the local player name.automation
geteduclientinfo00x6no lang entryeducation automation
closewebsocket00x6Closes websocket connection if there is one.websocket automation
enableencryption00x6no lang entrywebsocket automation
getchunkdata30x6Gets pixels for a specific chunk.automation, map
getchunks30x6Gets list of chunks that are loaded.automation, map
getspawnpoint30x6Gets the spawn position of the specified player(s).automation
globalpause30x6Sets or gets the paused state of the game for all players.automation, education
gettopsolidblockruntime value0x6Gets the position of the top non-air block below the specified positionautomation
querytargetruntime value0x6Gets transform, name, and id information about the given target entity or entities.automation
listd30x6no lang entrythe 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, listd and agent. 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 gave commands.generic.unknown. In this world they are not registered or are hidden. geteduclientinfo, getlocalplayername, gametips and globalpause could not be told apart by the response (they were not in the list; the follow-up measurement below tells them apart).
  • /gettopsolidblock gave commands.generic.syntax, and /gettopsolidblock ~ ~ ~ gave commands.generic.error.permissions. /querytarget @s and /listd also gave commands.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 the 0x4 bit (player origin blocked) of flag 0x6. Raising the host permission level does not unblock them in player chat {code}. Their output could not be measured because of the refusal. /agent gave commands.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 /help list 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, querytarget and listd are 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 hello sent a packet and the server answered commands.generic.unknown (parameter ["party"]). /gametips enable and /gametips disable were handled by the client without a packet, printed Game tips enabled and Game tips disabled in chat (the game's localized text) and changed the option game_tips_enabled to 1 and 0. With no argument or maybe it is a local syntax error. /getlocalplayername, /geteduclientinfo, /closechat and /closewebsocket gave a permission-level error with no packet (consistent with the 0x4 block), also with cheats on. /enableencryption without 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) got commands.generic.unknown from the server. /agent gave commands.generic.syntax, so it exists on the server {measured}. The earlier "registered behind a client condition (party service)" is a code reading, and why party is 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 hello sent no CommandRequest packet 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 /p offered only packstack, permission, deop, help and op. In this world party is not registered or is hidden. Permission 0 and flag 0x80 alone 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, /closewebsocket and /ability @s mayfly true also all gave the same local message with no packet. Typing /listd to the end in the input line showed no autocomplete entry. In this world they are not visible and cannot be used.
  • As a control, /list sent a packet and returned commands.players.list (parameters ["1","8"]) and the name list.
  • With cheats off, listd was refused and absent from autocomplete in a case where both the permission level (signature permission 3) and the 0x4 of flag 0x6 hide it, so this measurement cannot separate the two. With cheats on and enough permission, it should still not appear in player chat autocomplete because of 0x4 {code} (not measured). The statement that listd is visible in game with op-permission-level=4 is 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}.

CommandSyntax
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, codeno arguments
worldbuilderno arguments. Alias wb
immutableworld<value: Boolean>
getspawnpoint<player: target>
getchunks1 argument (appears to be a dimension type)
getchunkdata4 arguments: dimension, chunkX, chunkZ, height
globalpause[isPaused: Boolean]
ability<player: target> <ability: Ability> [value: Boolean] as two overloads (order and the Ability values unconfirmed)
takepicture3 overloads: targetPlayer and targetCamera (actor selector), targetPlayer and cameraSpawnLocation (position), targetPlayer
resourceuri4 overloads: no arguments, clear, default <uri>, named <name> <uri>
enableencryption3 arguments: publicKey, salt, and the cipher mode (the argument name is misspelled ciper_mode; values cfb8, cfb128 and others)
lesson, codebuilderseveral enums and a player selector. lesson has 4 overloads. The details were not resolved
codebuilder_actorinfoCodeBuilderActionInventory and the actor selector target
agenta 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.NameTypeDefaultCheats
0commandBlockOutputbooleantruerequired
1doDayLightCyclebooleantruerequired
2doEntityDropsbooleantruerequired
3doFireTickbooleantruenot required
4recipesUnlockbooleantruenot required
5doLimitedCraftingbooleanfalsenot required
6doMobLootbooleantruenot required
7doMobSpawningbooleantruerequired
8doTileDropsbooleantruenot required
9doWeatherCyclebooleantruerequired
10drowningDamagebooleantruerequired
11fallDamagebooleantruerequired
12fireDamagebooleantruerequired
13keepInventorybooleanfalserequired
14mobGriefingbooleantruerequired
15pvpbooleantruenot required
16showCoordinatesbooleanfalsenot required
17playerWaypointsinteger (enum playerwaypointsRule, values everyone, off)1not required
18locatorbarbooleantruenot required
19showDaysPlayedbooleanfalsenot required
20naturalRegenerationbooleantruenot required
21tntExplodesbooleantruenot required
22sendCommandFeedbackbooleantruerequired
23maxCommandChainLengthinteger65535required
24doInsomniabooleantruerequired
25commandBlocksEnabledbooleantruerequired
26randomTickSpeedinteger1required
27doImmediateRespawnbooleanfalsenot required
28showDeathMessagesbooleantruenot required
29functionCommandLimitinteger10000required
30spawnRadiusinteger10not required
31showTagsbooleantruenot required
32freezeDamagebooleantruerequired
33respawnBlocksExplodebooleantruenot required
34showBorderEffectbooleantruerequired
35showRecipeMessagesbooleantruenot required
36playersSleepingPercentageinteger100not required
37projectilesCanBreakBlocksbooleantruenot required
38tntExplosionDropDecaybooleanfalsenot 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, playerwaypointsRule and playerwaypointsValues.

8. Full reference​

The command list and introduction documents are included as MS Learn original excerpts in the command list.

Sources
idSourceLicenseCommitAccessed
private-researchPrivate research (-)-2026-11-13
bedrock-wikiBedrock WikiCC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository)0930b392026-11-13
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13
repo-damage-indicatorPremium 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