命令

来自Minecraft基岩版开发Wiki
Miemie Method留言 | 贡献2021年9月19日 (日) 15:54的版本 →‎历史

命令(Command)是通过输入特定文本字符串而激活的高级功能。

使用方法

命令列表

命令概述
命令 描述 权限等级 命令旗标1 命令旗标2
/? 提供命令使用帮助。 0 8 64
/ability 赋予或剥夺玩家的能力。 1 0 0
/addrider 为一个实体添加骑手。 1
/agent 操纵智能体。 1 6 0
/aicreate 为生物创建AI意向。 1
/aigoals 开关实体顶部的AI意向的信息绘制。 1
/aistop 停用实体的AI意向 1
/alwaysday 锁定或解锁日夜循环。 1 0 0
/audioaction commands.audioaction.description 1
/automate 执行自动化行为树。 1
/bhave 执行行为树。 1
/bossbar 修改或查询Boss栏。 0
/bounds 开关实体边界箱的绘制。 1
/camera commands.camera.description 1
/camerashake 启用镜头抖动效果。 1 0 0
/changedimension 传送玩家到一个在其它维度的位置。 1
/changename 更改一个生物的名字。 1
/changesetting commands.changesetting.description 4 0 0
/cheat_ability pins an ability to a specified state, simulating cheating 0
/cheat_local_player_health sets a player's health to the specified value, but doesn't send it to the server, for testing server authoritative health changes 0
/cheat_movement_debug enables debug rendering for movement cheating 0
/classroommode 尝试启动并连接到教室。 0 0 0
/cleanroom Helper command that Runs 'spawning' and 'wipeout' at the same time. So all entities go away and do not come back through spawning. 1
/clear 清空玩家背包中的物品。 1 0 0
/clearloadedstructures 清楚加载的结构。 1
/clearspawnpoint 移出一个玩家的世界出生点。 1 0 0
/clone 将一个区域的方块复制到另一个区域。 1 0 0
/closewebsocket 关闭Websocket连接。 0 6 0
/code 启动代码编辑器 0 0 0
/codebuilder commands.codebuilder.description 1 4 0
/connect 尝试使用给出的URL链接连接到Websocket服务器。 2 16 0
/corruptworld Corrupts the world loaded on the server. 1
/crashclient 1
/crashserver 使连接到的服务端崩溃(可能是本地)。 1
/createlocalworld 在本机创建一个新的世界。 1
/currenttick 设置当前世界每秒的刻数。 0
/daylock 锁定或解锁昼夜交替。 1 0 0
/debugcamera commands.debugcamera.description 1
/debugprofile Captures the last N frames and saves the data to a file. 1
/dedicatedwsserver 尝试连以给出的URL链接接到WebSocket服务器。 0 6 0
/deop 撤销一个玩家的管理员权限。 2 64 0
/destroyblock 破坏指定位置的方块。 1
/dialogue 为一名玩家打开NPC的对话界面。 1 0 0
/difficulty 设置世界难度。 1 0 0
/dumpblocknames Gets block names from a range and dumps them into a string. 1
/dumpblockpalette Outputs valid block nbt for vanilla and bedrock blocks in a binary format. 1
/dumpentitiesclient Dump out info on all entities in the current dimension 1
/dumpentitiesserver Dump out info on all entities in the current dimension 1
/effect 为生物添加或移出状态效果。 1 0 0
/enableedunpc 是否允许在地图内生成NPC: true允许, false禁止 0
/enableencryption commands.enableencryption.description 0 6 0
/enchant 为一名玩家手持的物品附魔。 1 0 0
/enchantrandom 为玩家手持的物品附魔随机魔咒。 1
/equip Equips a selection of entities with an item 0
/event 为指定实体触发事件。 1 0 0
/execute 以不同的方式执行命令。 1 0 0
/fill 在一个区域内填充方块。 1 0 0
/fillchestblock 使用物品填充箱子。 1
/filldrive Fills the user save and keeps a certain amount of bytes remaining. 1
/filllevelstorage Fill level storage with bytes of dummy data. 1
/findanchoredbuildpos Given a specific destination block position, this method finds a valid position for the player to be at in order for them to place a block at that position. 1
/findflatarea Finds a flat area for further actions. 1
/findnearbypickup Finds a nearby pickup. 1
/fixbiomes Regenerate biomes in a chunk radius around the players 1
/fly 更改玩家的飞行状态。 1
/fog 添加或移除迷雾文件。 1 0 0
/function Runs commands found in the corresponding function file. 1 0 0
/gamemode Sets a player's game mode. 1 0 0
/gamerule Sets or queries a game rule value. 1 64 0
/gametest Interacts with gametest. 1 1 0
/getblockname Gets block names at a given blockpos 1
/getchestcontents Gets contents of a chest 1
/getchunkdata Gets pixels for a specific chunk. 3 6 0
/getchunks Gets list of chunks that are loaded. 3 6 0
/getdurability Durability of selected item. 0 1 0
/geteduserverinfo commands.geteduserverinfo.description 0 6 0
/getexperience Returns the players current experience (score) 1
/getmobdebuginfo Retrieves the debug string for a given mob. 1
/getpower Gets the power at a given blockpos. 1
/getselecteditemcount Determine item count of inventory item. 1
/getspawnpoint Gets the spawn position of the specified player(s). 3 6 0
/getstructure Gets the structure that the player is current occupying 1
/gettopsolidblock Gets the position of the top non-air block below the specified position 0‌ ‌[仅教育版] / 1‌  ‌[仅基岩中国版] 6 0
/getworidname Gets the name of the current world (aka level). 1
/give Gives an item to a player. 1 0 0
/globalpause Sets or gets the paused state of the game for all players. 3 6 0
/health Modifies a mobs's health. 1
/help Provides help/list of commands. 0 8 64
/hunger Modifies a player's hunger level. 1
/immutableworld Sets the immutable state of the world. 1 0 0
/insomnia Gets and sets the player's insomnia level. 1
/islargechestblock Check to see if block is a large chest. 1
/isplayercrouching Returns if the player is crouching 1
/isplayerflying Returns if the player is flying 1
/isplayergrounded Returns if the player is grounded 1
/isworldloaded Checks if the client is loaded into a world. 1
/joinlangame Join a game on a remote host. 1
/kick Kicks a player from the server.‌ ‌[仅基岩版] / Removes a player from the game.‌ ‌[仅教育版] 1‌  ‌[仅基岩中国版] / 3‌ ‌[仅教育版] 64 0
/kill Kills entities (players, mobs, etc.). 1 0 0
/kit Gives the local player a kit. 0
/leaveworld Leaves the current world (aka level), goes back to start menu screen. 1
/lighttexturewriter Write the current dimension light texture to disk 1
/list Lists players on the server. 0 64 0
/listd commands.listd.description 3 6 0
/loadbehaviortreedefinitions Loads all of the automation behavior tree definitions. 1
/locate Displays the coordinates for the closest structure of a given type. 1 0 0
/log Modifies log settings or filters. 0
/lookat Forces the player to look at a floating point location 1
/me Displays a message about yourself. 0 32 64
/memwarn Fires low memory warning. 0
/mobevent Controls what mob events are allowed to run. 1 0 0
/mobinfo Toggles drawing mob information 1
/msg Sends a private message to one or more players. 0 32 64
/music Allows you to control playing music tracks. 1 0 0
/nearbyentityisbaby Returns true if the nearest entityType is a baby 1
/notifyprofiler Sends a message to the profiler to peform an action. 1
/op Grants operator status to a plaqer. 2 64 0
/openlocalworld Opens an existing world (aka level) on the local machine. 1
/ops Reloads and applies permissions. 4 0 0
/option Allows you to check or change the value of an option for the primary user 1
/packetprofile outputs verbose historq of packet stats to console 0
/particle Creates a particle emitter 1 0 0
/particlelegacy Fires a legacy particle in the world 0
/paths Disables Drawing Paths 1
/pause commands.pause.description 1
/permission Reloads and applies permissions. 4 0 0
/placefeature Places a feature or feature rule in the given chunk. 1
/placefromhand Places the current selected inventory item to the given position, if possible 1
/placejigsaw Places a jigsaw piece and goes through the jigsaw generation in the given chunk. 1
/placestructure Places a structure 1
/playanimation Makes one or more entities play a one-off animation. Assumes all variables are setup corrrectly. 1 0 0
/playerstat Gets stats about a player 1
/playsound Plaqs a sound. 1 0 0
/postrackclient Track a position within the world using a handle (Client) 1
/postracksrv Track a position within the world using a handle (Server) 1
/profile Shows the players profile with the specified name. 1
/querytarget Gets transform, name, and id information about the given target entity or entities. 0‌ ‌[仅教育版] / 2‌  ‌[仅基岩中国版] 6 0
/quit Quit the app. 1
/raid Triggers a raid at the originator's location, if they are in or near a village 1
/record Records or replays a session. 1
/redstonetest Outputs the redstone graph to a visual studio test. 1
/register3pserver Registers a 3P Server in the 3P Server Repositoty. 1
/reload Reloads all function files from all behavior packs. 2 0 0
/reloadanims Reload animation data. 1
/remove Removes entities (players, mobs, etc.). 2 0 0
/removeedunpc 删除地图内所有NPC 0
/replaceitem Replaces items in inventories. 1 0 0
/resourceuri Sets the resource URI in pause menu 0 0
/restart commands.restart.description 1
/resupply Triggers resupply on an entity's economy trade table. 1
/ride Makes entities ride other entities, stops entities from riding, makes rides evict their riders, or summons rides or riders. 1 0 0
/rot Sets a player's current rotation. 1
/save Control or check how the game saves data to disk. 4 0 0
/savestructure Saves a structure 1
/say Sends a message in the chat to other players. 1 32 64
/schedule Schedules an action to be executed once an area is loaded, or after a certain amouont of time. 1 0 0
/scheduler Disables Drawing scheduler information 1
/scoreboard Tracks and displays scores for various objectives. 1 0 0
/seencredits Marks or unmarks an actor as having seen credits. 1
/selectinventoryitem Equips a passed item. 1
/sendmodalform Sends a request to show a form to the target player 1
/sendshowstoreoffer Sends a request to show a store offer to the target player. 1
/serverinfo Show Environment in which server is running 1
/setblock Changes a block to another block. 1 0 0
/setmaxplayers Sets the maximum number of players for this game session. 3 0 0
/setworldspawn Sets the world spawn. 1 0 0
/showallitems Sends a request to show third party store offers to player. 0
/showfrustum Displays and freezes the player frustum. 1
/simlock Locks simulation time. 1
/simscale Scales the passage of simulation time. 1
/skin Gets the current player skin. 1
/spawnfeature commands.spawnfeature.description 1
/spawngroup Spawns a mob group at a specified location. 1
/spawning Toggles the spawning of enti ties. 1
/spawnitem Spawns an item entity at position 1
/spawnmob Spawns a mob to a particular state. 1
/spawnpoint Sets the spawn point for a plaqer. 1 0 0
/spreadplayers Teleports entities to random locations. 1 0 0
/stop Stops the server. 4 0 0
/stopsound Stops a sound. 1 0 0
/stoptime Resumes time elapse. 1
/structure Saves or loads a structure in the world. 1 0 0
/summon Summons an entity. 1 0 0
/systemstat Returns or sets runtime statistics for the game 1
/tag Manages tags stored in entities. 1 0 0
/takepicture Takes a photo of a player or from a player's point of view. 1 0 0
/teleport Teleports entities (players, mobs, etc.). 1 0 0
/tell Sends a private message to one or more players. 0 32 64
/tellraw Sends a JSON message to players. 1 32 64
/test Exectues‌[原文如此] a test via the test manager. 1
/testassets Upload or download test assets via the test manager. 1
/testfor Counts entities (plagers, mobs, items, etc.) matching specified conditions. 1 0 0
/testforblock Tests whether a certain block is in a specific location. 1 0 0
/testforblocks Tests whether the blocks in two regions match. 1 0 0
/tickingarea Add, remove, or list ticking areas. 1 0 0
/time Changes or queries the world's game time. 1 0 0
/timelock Resumes time elapse. 1
/title Controls screen titles. 1 32 0
/titleraw Controls screen titles with JSON messages. 1 32 0
/toggledownfall Toggles the weather. 1 0 0
/tp Teleports entities (players, mobs, etc.). 1 0 0
/tpb Teleport to specified biome 0
/tptobiome Teleport to specified biome 0
/tptosuitabletree Teleports the player to a position where they can chop down a tree. 1
/transferserver Transfers a player to another server. 1
/validategamelighting Validate game lighting for a specified region 1
/videostream Attempts to connect to the websocket server to send a video stream. 0 0 0
/videostreamaction Perform a videostream related action. 0 0
/villagehero Forces the Village to start bestowing the Hero of the Village effect as if you won a raid. 1
/villages Disables Drawing Village Debug Info 1
/w Sends a private message to one or more players. 0 32 64
/wb Toggle World Builder status of caller. 1 0 0
/weather Sets the weather. 1 0 0
/whitelist Manages the server whitelist. 4 0 0
/wipeout Wipes out entities across all dimensions. 1
/worldbuilder Toggle World Builder status of caller. 1 0 0
/wsserver Attempts to connect to the websocket server on the provided URL. 2 16 0
/xp Adds or removes player experience. 1 0 0

命令可用性

命令 BE CN EE BEDEV CNDEV BDS CB DC UC EDU EX
/?
/ability
/addrider
/agent
/aicreate
/aigoals
/aistop
/alwaysday
/audioaction
/automate
/bhave
/bossbar
/bounds
/camera
/camerashake 即将到来 即将到来 即将到来
/changedimension
/changename
/changesetting
/cheat_ability
/cheat_local_player_health
/cheat_movement_debug
/classroommode 是‌[隐藏] 是‌[隐藏]
/cleanroom
/clear
/clearloadedstructures
/clearspawnpoint 即将到来 即将到来 即将到来
/clone
/closewebsocket
/closewebsocket
/code 是‌[隐藏]
/codebuilder
/connect
/corruptworld
/crashclient
/crashserver
/createlocalworld
/currenttick
/daylock
/debugcamera
/debugprofile
/dedicatedwsserver
/deop
/destroyblock
/dialogue
/difficulty
/dumpblocknames
/dumpblockpalette
/dumpentitiesclient
/dumpentitiesserver
/effect
/enableedunpc
/enableencryption
/enchant
/enchantrandom
/equip
/event 即将到来 即将到来 即将到来
/execute
/fill
/fillchestblock
/filldrive
/filllevelstorage
/findanchoredbuildpos
/findflatarea
/findnearbypickup
/fixbiomes
/fly
/fog 即将到来 即将到来 即将到来
/function
/gamemode
/gamerule
/gametest 即将到来 即将到来 即将到来
/getblockname
/getchestcontents
/getchunkdata 是‌[隐藏] 是‌[隐藏]
/getchunks 是‌[隐藏] 是‌[隐藏]
/getdurability 是‌[隐藏]
/geteduserverinfo
/getexperience
/getmobdebuginfo
/getpower
/getselecteditemcount
/getspawnpoint 是‌[隐藏] 是‌[隐藏]
/getstructure
/gettopsolidblock
/getworidname
/give
/globalpause 是‌[隐藏] 是‌[隐藏]
/health
/help
/hunger
/immutableworld
/insomnia
/islargechestblock
/isplayercrouching
/isplayerflying
/isplayergrounded
/isworldloaded
/joinlangame
/kick
/kill
/kit
/leaveworld
/lighttexturewriter
/list
/listd
/loadbehaviortreedefinitions
/locate
/log
/lookat
/me
/memwarn
/mobevent
/mobinfo
/msg
/music 即将到来 即将到来 即将到来
/nearbyentityisbaby
/notifyprofiler
/op
/openlocalworld
/ops
/option
/packetprofile
/particle
/particlelegacy
/paths
/pause
/permission
/placefeature
/placefromhand
/placejigsaw
/placestructure
/playanimation 即将到来 即将到来 即将到来
/playerstat
/playsound
/postrackclient
/postracksrv
/profile
/querytarget
/quit
/raid
/record
/redstonetest
/register3pserver
/reload
/reloadanims
/remove
/removeedunpc
/replaceitem
/resourceuri
/restart
/resupply
/ride 即将到来 即将到来 即将到来
/rot
/save
/savestructure
/say
/schedule 即将到来 即将到来 即将到来
/scheduler
/scoreboard
/seencredits
/selectinventoryitem
/sendmodalform
/sendshowstoreoffer
/serverinfo
/setblock
/setmaxplayers
/setworldspawn
/showallitems
/showfrustum
/simlock
/simscale
/skin
/spawnfeature
/spawngroup
/spawning
/spawnitem
/spawnmob
/spawnpoint
/spreadplayers
/stop
/stopsound
/stoptime
/structure 即将到来 即将到来 即将到来
/summon
/systemstat
/tag
/takepicture
/teleport
/tell
/tellraw
/test
/testassets
/testfor
/testforblock
/testforblocks
/tickingarea
/time
/timelock
/title
/titleraw
/toggledownfall
/tp
/tpb
/tptobiome
/tptosuitabletree
/transferserver
/validategamelighting
/videostream
/videostreamaction
/villagehero
/villages
/w
/wb
/weather
/whitelist
/wipeout
/worldbuilder
/wsserver
/xp

历史

携带版(Alpha)
0.7.4加入了对命令的支持,但尚未实现任何命令的运行。
0.16.0build 1加入了/clearfixedinv/clone/deop/execute/fill/gamemode/give/help(及其别名/?)、/kill/list/op/say/setblock/setfixedinvslot/setworldspawn/spawnpoint/summon/tell(及其别名/msg/w)、/testforblock/testforblocks/time/toggledownfall/tp(及其别名/teleport)、/weather/wsserver/xp命令。
大部分命令的功能与Java版1.10相同。差别在于:不支持数据标签、/clone命令无法使用forced模式、/gamemode命令仅允许指定创造模式和生存模式、/give命令中玩家目标为可选参数,以及/execute命令中实体目标为可选参数。
build 2移除了/clearfixedinv/setfixedinvslot及其他教育版相关的命令。
build 5加入了/enchant命令。
携带版
1.0.00.17.0.1加入了/locate/connect命令。
0.17.0.2移除了/locate命令。
1.0.0.0重新加入了/locate命令。仅能用于查找要塞。
1.0.31.0.3.0加入了/transferserver命令。
1.0.51.0.5.0加入了/clear/difficulty/effect/gamerule/me/particle/playsound/replaceitem/spreadplayers/stopsound/testfor/title命令。
1.0.5.3移除了/particle命令。
/effect命令的amplifier参数不再允许为负值。
1.1.01.1.0.0/replaceitem支持canplaceoncandestroy
/locate可查找其他结构。
加入了游戏规则dodaylightcycledoentitydropsdofiretickdomobspawningdomoblootdotiledropsdoweathercyclekeepinventorymobgriefing
?加入了/setmaxplayers
基岩版
1.2.01.2.0.2加入了/tickingarea
1.4.0?/transferserver移动到开发者命令,玩家不再能够正常使用。
1.5.01.5.0.0为启用教育版功能的世界加入了5个新命令。
1.6.01.6.0.6/gamerule加入了游戏规则doInsomnia
1.7.01.7.0.2加入了/scoreboard
加入了了游戏规则commandblocksenabled
1.8.01.8.0.8重新加入了/particle
加入了randomTickSpeed游戏规则。
加入了/reload
加入了/function
1.9.01.9.0.0加入了/tellraw
加入了showdeathmessages游戏规则。
加入了immediaterespawn游戏规则。
/particle加入了新粒子。
1.11.01.11.0.1加入了/resupply,但并没有作用。
1.11.0.3加入了/mobevent
1.12.01.12.0.2加入了spawnradius游戏规则。
/clear的特殊值功能失效。
加入了sendcommandblockfeedback游戏规则。
/particle加入了更多的新粒子。
为地图制作及Add-ons加入了新命令。
?移除了/resupply
1.14.01.14.0.3/clear的特殊值功能被修复。
1.16.01.16.0.57加入了/kick命令。
正式版加入了/whitelist命令。
1.16.1001.16.100.52加入了/playanimation/ride/structure命令。
1.16.100.54加入了/fog命令。
1.16.100.57加入了/camerashake/clearspawnpoint/event命令。
1.16.100.58加入了/music命令。
1.16.100.59加入了/schedule命令。
1.16.2101.16.210.53移除了/mixer命令。
1.16.210.54重新加入了/mixer命令。
1.16.210.58再次移除了/mixer命令。
1.16.210.60加入了/gametest命令。
1.17.01.16.230.50/whitelist重命名为/allowlist
1.17.101.17.10.22加入了/dialogue命令。

漏洞

关于“命令”的漏洞在国际版中由漏洞追踪器维护,请在此报告漏洞。

参见