警告:根据CC BY-NC-SA 3.0协议,所有从wiki搬运的资料都必须写上来源出处(中文Minecraft Wiki),否则将被视为侵权行为!详细阅读
致繁体用户:本wiki现已更新简繁更换系统,各位用户可以通过简繁切换来查看正确的繁体译名

命令

出自Minecraft Wiki
(重定向自多人游戏服务器指令
跳轉到: 導覽搜尋

命令(commands)是藉由輸入特定文本字符串而激活的進階功能。

使用方法[編輯]

請注意,本條目所述皆為官方原版遊戲中的指令。列表外的指令均非原版指令。


一般的客戶中,命令由 Minecraft聊天視窗中輸入,藉由按下 T 鍵(預設) 或 / 鍵叫出聊天視窗。使用 / 鍵也會同時輸入命令必備的前綴斜線,因此這是個實用的快捷鍵。在輸入命令時按下 Tab ↹ 鍵會循環可用的命令或參數。

命令也可以在多人服務器的控制台輸入,但是不需要加入前綴的 / 。指令方塊中的命令可以加入前綴 / ,但是非必要。指令方塊中的命令可能還會要求可選擇的參數,通常是玩家的名字。

大多數命令只能在以下狀況有效:

有些#命令在不允許作弊的生存模式中仍然可用

注意:在單人遊戲中,如果不允許作弊,仍可以藉由公開目前的遊戲至局域網 ( Esc → "公開至局域網" ,點選 "允許作弊" ,接着 "公開至局域網" ) 而暫時可以作弊。你不必真的在局域網上或讓別人加入。這並不是永久的,但它可以允許命令的使用直到你離開該世界,你使用命令所改變的東西都會被存檔 (items spawned 等命令) 。你可以在再次開啟遊戲時重複以上步驟。注意當公開至局域網時遊戲便無法暫停,所以在打開遊戲目錄時最好找個安全的地方。你可以重新載入世界來取消公開至局域網。

如果在指令方塊中執行測試類命令(例如/testfor),指令方塊會將測試結果以紅石信號形式輸出到相連的紅石比較器中。

波浪號[編輯]

很多命令可以使用波浪號(~)來指定相對座標。在波浪號後方的數字是個 偏移量 而不是一個座標。偏移符號可以指定要往軸的正或負方向移動。一個單一的波浪號可以簡寫為 ~0

舉例來說, tp 0 64 0 將會移動使用者到座標 (0, 64, 0),而 tp ~3 ~ ~-3 會使使用者往 x 軸正向移動3格 (也就是東方),保持原本高度,並在 z 軸移動-3格 (也就是北方)。

通常絕對座標和相對座標可以溷合使用。舉例來說, tp ~ 64 ~ 會保持使用者的 x 軸和 z 軸座標,但是傳送使用者到絕對高度64。

偏移量的基準點由命令本身決定。舉例來說, /tp 的偏移是從起始位置來算。其他常見的偏移量包括命令的執行位置或者從另一個坐標由該命令指定。

目標選擇器[編輯]

:本段文字中,variable 翻譯為變數,argument 翻譯為參數,而value 代表數值。有些指令因為易讀性的關係,並不會把它翻譯出來。

大多數玩家被指定為參數的命令,可以藉由滿足某些條件來選擇一個或多個玩家,而不是用名字來指定玩家。要用條件來選擇玩家,先選擇一個目標選擇器變數,然後隨意地,選擇一個或多個目標選擇器參數以修改欲滿足的條件。

舉例來說,要改變紅色組別所有玩家的遊戲模式為創造模式,而不藉由個別玩家名字指定他們:

/gamemode creative @a[team=Red]


目標選擇器變數[編輯]

摘要
變數 功能
@p 距離最近的玩家
@r 隨機玩家
@a 所有玩家
@e 所有實體

目標選擇器變數可以指定選擇該目標大類。共有四種變數:

@p
選擇最近的玩家。如果有多個最近的玩家,他們與自己距離完全相同,那麼會選擇其中最常進入服務器的玩家。
目標選擇器參數可以用來減少會被選擇到的玩家群組。舉例來說,@p[team=Red] 會選擇在紅色組別中距離最近的玩家,即使有其他玩家更靠近自己。
c 目標選擇器參數可以用來增加被選擇的玩家的數量。( 舉例來說,@p[c=3] 會選擇最近的三名玩家)。若是負值,c 會反轉指定的目標 (舉例來說,@p[c=-1] 會選擇 最遠的 玩家)。
@r
選擇隨機玩家 (或使用 type 目標選擇器參數來包含實體)。
目標選擇器參數可以用來減少會被隨機選擇到的玩家群組。舉例來說,@r[team=Red] 會選擇在紅色組別中的隨機玩家。
c 目標選擇器參數可以用來增加被隨機選擇的玩家的數量。舉例來說,@r[c=3] 會選擇隨機三名玩家。
如果沒有使用 type 參數,@r 只會選擇隨機玩家。type 參數可以用來選擇非玩家的實體 (舉例來說,@r[type=Zombie] 會隨機選擇殭屍@r[type=!Player] 會隨機選擇非玩家實體,@r[type=!Zombie] 會選擇非殭屍實體...等)。
@a
選擇所有玩家。
目標選擇器參數可以用來減少會被選擇到的玩家群組。舉例來說,@a[team=Red] 只會選擇在紅色組別中的玩家。
@e
選擇所有實體 (包含玩家)。
目標選擇器參數可以用來減少會被選擇到的實體群組。舉例來說,@e[type=Cow] 只會選擇牛。


目標選擇器參數[編輯]

摘要
參數 選擇標準
x, y, z 座標
r, rm 半徑 (最大,最小)
m 遊戲模式
c 數量
l, lm 經驗等級 (最大,最小)
score_name 最高分數
score_name_min 最低分數
team 隊伍名稱
name 玩家名稱
dx, dy, dz 體積尺寸
rx, rxm 垂直旋轉 (最大,最小)
ry, rym 水平旋轉 (最大,最小)
type 實體種類

在使用目標選擇器之後,你可以隨意地使用參數來修改所要選擇的群組。當使用 @a@e 時,參數縮小所選的數量,從所有名單到特定的少數。當使用 @p@r 時,參數縮小所選的數量,從所有名單變成更小的群組來選擇最近或隨機的玩家。

在目標選擇器變數之後增加參數 - 數值對做為以逗號分隔的列表,包含在中括號中:

@<variable>[<argument>=<value>,<argument>=<value>,…]

括號、等號和逗號旁不能有空白鍵,只有逗號可以用來分隔參數 - 數值對。

參數會區分大小寫,不支持的參數會直接被忽略掉。舉例來說,kill @e[type=Creeper,r=20] 會殺死20方圓格以內的所有苦力怕,但是 kill @e[Type=Creeper,r=20] ('type' 變成大寫) 會殺死20方圓格以內的 所有 實體 (包括玩家) ,因為參數不再有選擇苦力怕的限制。

如果最前面的四個參數值被簡化為只有數值而沒有參數,他們會被假定為,按照順序的 x, y, z, 和 r。因此,下列兩個指令是相同的:

/gamemode creative @a[x=10,y=20,z=30,r=4]
/gamemode creative @a[10,20,30,4]
通過坐標選擇目標
[x=X,y=Y,z=Z] — 選擇基於此準確位置一定距離的目標。結合選擇半徑以選擇在特定位置的唯一目標。
坐標必須準確的符號 - #波浪號 不可以用於此參數座標選擇器。
通過半徑選擇目標
[r=R] — 只選擇以命令的執行處為中心,半徑小於R的區塊里的目標。
[rm=RM] — 只選擇以命令的執行處為中心,半徑大於RM的區塊里的目標。
如果座標(參見上一段)和半徑都已被定義,命令會以定義的座標為中心執行命令。如果使用極遠的座標為中心以及極大的半徑,如此可以模擬出一個近於線性的邊緣,用以指定目標。
通過遊戲模式選擇目標
[m=M] — 只選擇目標與指定的遊戲模式M 允許值為:
  • -1: 所有的遊戲模式
  • 0: 生存模式
  • 1: 創造模式
  • 2: 冒險模式
  • 3: 旁觀模式
通過數量選擇目標
[c=C] — 只選擇指定數量的目標。通常按與命令執行者的距離排序。
當使用 @p@r 兩種變數時,此參數被預設為1,因此更大的數值會增加回傳的最近或隨機的目標。當使用 @a@e 兩種變數時,此參數只會回傳最近的目標。
如果有多名距離最近的玩家,距離完全相同,那麼玩家會藉由玩家最近一次加入服務器的時間來選擇。舉例來說,如果距離完全相同@a[c=1] 會選擇進入服務器時間最久的玩家而 @e[type=Creeper,c=3] 會選擇生成最久的三隻苦力怕。
當輸入的值為負值時,目標的順序會被反轉。舉例來說,@p[c=-3] 會回傳三個最遠的目標,而且,如果所有目標距離都一樣遠,@e[c=-3] 會選擇三個剛生成的目標。
通過經驗等級選擇目標
[l=L] — 只選擇不超過 L 經驗等級的目標。
[lm=LM] – 只選擇不低於 LM 經驗等級的目標。
通過分數選擇目標
[score_name=SCORE] — 只選擇目標計分板 name 的分數的沒有超過 SCORE 的目標。
[score_name_min=SCOREMIN] — 只選擇目標計分板 name 的分數的不低於 SCOREMIN 的目標。
例如,@a[score_points_min=30,score_points=39] 將選擇目標計分板 points 的分數的不低於 30 ,且不高於 39 的目標。
另見:記分板#對象
通過隊伍選擇目標
[team=TEAM] — 只選擇隊伍 TEAM 的目標。
[team=!TEAM] — 只選擇不是隊伍 TEAM 的目標。
[team=] — 只選擇不在任何隊伍的目標。
另見:記分板#隊伍
通過名字選擇目標
[name=NAME] — 只選擇名字為 NAME 的目標。
[name=!NAME] — 只選擇名字不是 NAME 的目標。
通過體積選擇目標
[dx=DX,dy=DY,dz=DZ]
只選擇位於一定體積內部的目標,體積定義為從執行命令的地方開始,向正 "x" 方向 (也就是東方) 延伸 DX 格,向正 "y" 方向 (也就是上方) 延伸 DY 格,並向正 "z" 方向 (也就是南方) 延伸 DZ 格。所有的值都必須為正值。如果最初的座標已經使用 xyz 參數定義,則它會取代命令的執行位置成為最下方、最北方及最西方的角落。 (dxdydz 仍然用來指定與座標的距離;它們不是指定一個新的座標)。
玩家可以結合通過半徑和通過體積選擇目標,此命令將會選擇重疊的區塊。 (從西北下角算起在一定的半徑以內,且不超過定義的體積)。
通過垂直旋轉選擇目標
[rx=RX] — 只選擇最大不超過垂直旋轉值 RX 的唯一目標。
[rxm=RXM] — 只選擇最小不低於垂直旋轉值 RXM 的唯一目標。
垂直旋轉值從 -90.0 面對正上方到 90.0 面對正下方 (因此垂直旋轉值增加時會旋轉向下)。
通過水平旋轉選擇目標
[ry=RY] — 只選擇與最大不超過水平旋轉值 RY 的唯一目標。
[rym=RYM] — 只選擇與最小不低於水平旋轉值 RYM 的唯一目標。
水平旋轉值從 -180.0 (面對正北方),到 -90.0 (面對正東方),到 0.0 (面對正南方),到179.9 (正北方偏西) ,旋轉回 -180.0 (因此水平旋轉值增加時會向右旋轉,或者從上方看來是順時針方向旋轉)。
通過類型選擇目標
[type=TYPE] — 只選擇特定的實體類型的目標。
[type=!TYPE] — 只選擇不是特定的實體類型的目標。
TYPE 必須是個用來內部判定不同種類實體的實體ID (舉例來說,Creeper 指定苦力怕MinecartRideable 指定一般的礦車PrimedTnt 指定TNT等等)。實體ID 必須區別大小寫,且無效的實體ID 會造成命令失敗。
當與 @r 一起使用時,原本用來選擇玩家的指令也可以被用來選擇其它實體。


數據標籤[編輯]

數據標籤是一段文字序列,使用屬性/值對描述資料結構。使用在命令的數據標籤指定了較複雜的玩家、實體和一些方塊的數據。

數據標籤由零個以上、用逗號分隔的的屬性/值對組成,且用大括號界定。每個屬性/值對包含屬性名稱和屬性值,用冒號分開。但是,有些屬性值可能本身就包含了屬性/值對,因此數據標籤可以用來描述層次結構。

例: {name1:123,name2:"sometext",name3:{subname1:456,subname2:789}}

這些數據標籤所描述的資料結構和 Minecraft 世界存檔中的資料結構是一樣的。這些資料結構在另一篇有詳細描述,而命令會要求數據標籤要使用一樣的屬性名字 (區分大小寫):

資料結構規範連結
對象 舉例
方塊 儲物箱、熔爐、指令方塊、刷怪蛋、告示牌...等等
物品 在物品欄中的物品 (包括附魔、自訂名稱...等等)
物品實體 在地上的物品
生物 苦力怕、牛、村民...等等
彈射物 弓箭、火球、噴濺藥水...等等
交通工具 船、礦車...等等
Dynamic tiles 引燃的 TNT、正在掉落的沙、礫石
其它實體 煙火、畫和物品展示框

定義的資料結構也要求正確種類的屬性值

數據標籤屬性值種類
種類 說明

 Byte
介於 -128 和 127 之間 (包含) 的整數。

 Short
介於 -32768 和 32767 之間 (包含) 的整數。

 Int
介於 -2147483648 和 2147483647 之間 (包含) 的整數。

 Long
介於 -9,223,372,036,854,775,808 和 9,223,372,036,854,775,807 之間 (包含) 的整數。

 Float

 Double
可以有浮點數的數字 (舉例來說:3.14159)

 String
一串文字,可以自由選擇是否要加上雙引號。

如果字符串包含逗號、中括號、大括號,一定 要加上雙引號。如果字符串裡面 要包含雙引號,需在雙引號前加上反斜線。

例: "Call me \"Ishmael\""

 List
值的序列,用逗號分離並用中括號包含。不必每個值都用同一種類型 -- 所需的類型由數據結構指定。.
例: [3.2,64,129.5]

 Byte Array
從 -128 到 127 的整數的序列,用逗號分離並用中括號包含。

 Int Array
從 -2147483648 到 2147483647 的整數的序列,用逗號分離並用中括號包含。

 Compound
屬性值對的序列,用逗號分離並用大括號包含。
Example: {X:3,Y:64,Z:129}

每個數據標籤的內容本身就是一種 Compound。

有些命令可能會要求那個數字的類型,以在數字後面加上一個字母來表示。舉例來說, 3i 表示整數,3.2f 表示浮點數...等等

如果用 /testfor/testforblock/clear 等指令來尋找相符的數據標籤,它們只會檢查那些實體/方塊/物品是否存在此標籤。這表示當找到符合的實體/方塊/物品時,它們可能同時還有其他標籤。這在 lists (表單) 和 arrays (序列) 也適用:表單的順序未被確認,只要每個要求的元素都在表單裡面,那麼即使有額外的元素存在,它也會符合條件。

數據結構的形式是 JSON 的一種形式 lenient

原始 JSON 文本[編輯]

/tellraw/title 指令使用特殊的lenient JSON 格式來表示更複雜的文字。和上述 NBT 格式表示法相似,Strings (字串)、Objects (Compounds)(物件,指複合體)、Lists (表單) 被用來表示原始文本的不同性質。

JSON 文本的形式是支援以下 (大多是可選擇的) 元素的 JSON 物件:


  • 基礎聊天組成物件

    •  text: String (字串) 代表在聊天中直接出現的純文字。注意像是"@a" 和 "@p" 的選擇器並不會轉譯成玩家名字;必須使用 selector 代替。"\n" 是新的一行 (enter 鍵)。

    •  extra: 外加物件的表單,使用和基礎物件相同的格式。

      • 為使用和基礎物件相同格式的表單元素 (遞迴的)。注意所有物件的性質都會被子物件所繼承,除了 textextratranslatewithscore。這表示子物件會保留和這個物件一樣的格式和情況,除非子物件明確的覆蓋原物件。

    •  color: 用來渲染文字的顏色。有效值有:"black" 、 "dark_blue" 、 "dark_green" 、 "dark_aqua" (碧綠)、 "dark_red" 、 "dark_purple" 、 "gold" 、 "gray" 、 "dark_gray" 、 "blue" 、 "green" 、 "aqua" 、 "red" 、 "light_purple" 、 "yellow" 、 "white" 和 "reset" (取消母對象使用的顏色效果)。技術上來說,"bold" (粗體)、 "underline" (底線)、 "italic" (斜體)、 "strikethrough" (刪除線) 和 "obfuscated" (模煳處理) 都是可接受的,不過最好還是使用下方提到的標籤格式。

    •  bold: 布爾 (true/false) - 是否將文字渲染為粗體,預設為 false。

    •  underlined: 布爾 (true/false) - 是否將文字渲染為加底線,預設為 false。

    •  italic: 布爾 (true/false) - 是否將文字渲染為斜體,預設為 false。

    •  strikethrough: 布爾 (true/false) - 是否將文字渲染為加上刪除線,預設為 false。

    •  obfuscated: 布爾 (true/false) - 是否將文字渲染為模煳處理,預設為 false。

    •  insertion: 當玩家按着 shift 並點擊時,這個字串就會插入至聊天文字欄。它不會覆蓋原有的正在輸入的文字。

    •  clickEvent: 當玩家在文字上點擊時發生動作。

      •  action: 當點擊時所引發的動作。有效值為 "open_url" (在玩家的預設瀏覽器中打開值為 value 的 URL 位址),"run_command" (在聊天欄輸入 value ,就好像是玩家自己輸入的一樣。這可以用來執行命令,但是如果玩家沒有所需的權限,命令會失敗。), "change_page" (只能用在完成的書,翻至第 value 頁如果該頁存在),和 "suggest_command" (和 "run_command" 相似,但是命令文字只會出現在玩家的聊天輸入欄,並不會自動執行。不像 insertion ,這會直接取代原先就存在於聊天輸入欄中的內容)。

      •  value: 特定的 action 會使用到的 URL 位址、聊天內容或命令。注意,命令之前一定要加上 "/" 斜線。

    •  hoverEvent: 允許當玩家滑鼠在文字之上時顯示提示。

      •  action: 提示所顯示的種類。有效值為 "show_text" (顯示純 JSON 文本), "show_item" (顯示可能帶有 NBT 標籤的物品的提示工具), "show_achievement" (顯示用來描述成就或數據的標準格式。一般的成就是綠色的,最終的成就是深紫色的,數據名稱是灰色的。除此之外,還有成就的描述),和 "show_entity" (顯示實體的名字,或可能是它的種類、和它的通用唯一識別碼)。

      •  value: 這個標籤的格式取決於 action (動作)。注意, "show_text" 是唯一支援物體當作值的動作;其他動作的值都是字串,所以必須用引號包含。
        • "show_text": 可以是純字串,或是和這個基礎物體的格式一樣的物體。注意,clickEventhoverEvent 在提示工具中不會有效果,但是它的格式和 extra 標籤仍然有作用。
        • "show_item": 像 NBT 標籤的格式化的字串。包含 "id" 標籤,和可選的 "Damage" 標籤和 "tag" 標籤 (和give指令所用的數據值和數據標籤一樣).
        • "show_achievement": The achievement or statistic's name. This uses the same format as achievement and statistic Scoreboard objective criteria and the /achievement command.
        • "show_entity": A string formatted like a compound with the string values "type" (such as "Zombie"), "name", and "id" (should be an entity UUID, but can actually be any string).

    •  translate: The translation identifier of text to be displayed using the player's selected language. This identifier is the same as the identifiers found in lang files from assets or resource packs. The translated text will only be displayed if the text string is not used.

    •  with: A list of chat component arguments and/or string arguments to be used by translate.
      • The arguments are text corresponding to the arguments used by the translation string in the current language, in order (for example, the first list element corresponds to "%1$s" in a translation string).

    •  score: A compound for displaying a player's score in an objective. Displays nothing if the player is not tracked in the given objective. Ignored completely if text or translate is present.

      •  name: The name of the player whose score should be displayed. Selectors (such as @p) can be used, in addition to "fake" player names created by the scoreboard system. In addition, if the name is "*", it will show the player's own score (for example, /tellraw @a {score:{name:"*",objective:"obj"}} will show every online player their own score in the "obj" objective). Note that non-player entity scores (such as @e[type=Cow]) do not show, even if the entity has been given a score in the objective.

      •  objective: The internal name of the objective to display the player's score in.

      •  value: Optional. If present, this value is used regardless of what the score would have been.

    •  selector: A string containing a selector (@p,@a,@r, or @e) and, optionally, selector arguments. Unlike text, the selector will be translated into the correct player/entity names. If more than one player/entity is detected by the selector, it will be displayed in a form such as 'Name1 and Name2' or 'Name1, Name2, Name3, and Name4'. Ignored completely if text, translate, or score is present.
外部連結
Skylinerw's JSON Formatting Examples
Tellraw Generator

玩家命令[編輯]

這些命令可由聯入服務器的任何玩家在聊天輸入框里直接輸入。

命令 描述
help [頁碼 | 命令名]
? [頁碼 | 命令名]
列出可以使用的命令或有關命令名更多的信息。
tell <玩家名稱> <信息>
msg<玩家名稱> <信息>
w <玩家名稱> <信息>
用來發送給服務器里的玩家一條私信。 在需要和玩家交流時非常有用。
me <動作信息> 和 /emote 或 /action相似,而且其作用和IRC客戶端里的 /me 命令一樣, /me命令會以敘述的方式顯示出這個玩家在做什麼,具體顯示為"* 你的名字 動作信息" (比如: "* 你的名字 打了個噴嚏。")。
trigger <目標> <add | set> <數值> 修改帶有Trigger準則的目標(被稱為觸發器),此命令可以被非管理員玩家使用。見版本記錄

只有管理員可用的命令[編輯]

這些命令只有管理員(Operator)通過服務器或客戶端使用。客戶端使用時需要加“/”前綴。例如輸入的應該是“/help”而非只是“help”。必需的參數由<尖括號>標出;可選的參數由[方括號]標出。用斜體標註的參數必須用一個適當的數值代替;用普通字體的參數直接照搬即可。

在單人生存模式中,開啟作弊功能且對局域網開放單人世界的服主也可以使用下列命令。

注意: 在多人模式下,普通玩家通常看不見OP指令的輸入,但是對於其他的在線OP卻是可見的。

命令 描述
achievement give <數據名> [玩家名] 用於賜予玩家成就
blockdata <x> <y> <z> <數據標籤> 用於編輯指定坐標的數據標籤
clear <玩家名> [物品] [數據] 清空該玩家的物品欄,或只清除特定的物品。
clone <x1> <y1> <z1> <x2> <y2> <z2> <X> <Y> <Z> [主模式] [子模式] 複製指定區域的方塊,目的坐標是(X,Y,Z),主模式有 [ replace ]複製每一個方塊、[ masked ]只會複製非空氣方塊、[ filtered ]過濾不想被影響的方塊。

子模式有 [ move | force | normal ]。

debug <start | stop> 開始一次新的除錯進程或是停止當前進程。除錯進程會監控任何控制台內的潛在信息並在停止之後將信息記錄在debug文件夾內。
defaultgamemode <survival | creative | adventure | spectator> 設置默認的遊戲模式。新加入的玩家將被設置為該模式。生存/創造/冒險/旁觀也可以簡寫為“s/c/a/sp”或“0/1/2/3”。
difficulty <0 | 1 | 2 | 3> 改變遊戲難度。0為和平,1為容易,2為普通,3為困難,
effect <玩家名> <藥水效果> [秒數] [倍率] 給予目標玩家持續指定時間的指定藥水效果(默認30秒,最長可設置1000000秒)。“倍率”代表效果強度(最大為255),0為取消該效果。藥水效果用ID表示,詳見藥水效果
effect <玩家名> clear 清除該玩家身上的所有效果。
enchant <玩家名> <魔咒ID> [魔咒等級] 附魔玩家持有的物品。請注意用該命令附魔的魔咒無法超越正常附魔步驟的限制,例如最大等級、魔咒衝突、魔咒限制等,詳見附魔
entitydata <實體名> <數據標籤> 用於編輯指定實體的數據標籤,對玩家無效
execute <玩家名 | 實體名> <x> <y> <z> <命令> 以目標玩家或實體為中心執行命令,可以用來通過玩家及實體的運動生成生物或放置方塊。
fill <x1> <y1> <z1> <x2> <y2> <z2> <方塊名> [數據值] [舊方塊處理方式]<數據標籤> 用指定方塊填滿指定區域。舊方塊處理方式可為:[ replace | destroy | keep | hollow | outline ]。能指定要處理的舊方塊種類,前提是不包含方塊實體值,僅能在replace模式中使用,語法:/fill [x] [y] [z] [x] [y] [z] [方塊名] [數據] replace [過濾方塊名] [過濾數據]
gamemode <survival | creative | adventure | spectator> [玩家名] 改變該玩家的遊戲模式。生存/創造/冒險/旁觀也可以簡寫為“s/c/a/sp”或“0/1/2/3”。如果未定義玩家名,那麼該命令會更改你自己的遊戲模式。注意: 要成功改變遊戲模式,該玩家必須在線。
gamerule <規則名> [true | false] 激活或取消規則名。規則包括:doFireTick, doMobLoot, doMobSpawning, doTileDrops, keepInventory, mobGriefing and commandBlockOutput(詳見指令方塊條目)
give <玩家名> <數據值> [數量] [附加數據值] 給予玩家的物品欄一定'數量(默認為1)的物品(由數據值方塊實體值(默認為0)定義)。
kill [玩家名] 對指定的玩家造成1000 (Heart.svg × 500)點傷害(一擊必殺),未指定則為使用該命令的玩家。 當你迷路或者被卡住的時候很有用。如果你有把握找回身上的物品,那麼這也是個快速補滿飢餓值的好方法。這個命令在創造模式下依然有效。
partcles <顆粒> <x> <y> <z> <x偏移量> <y偏移量> <z偏移量> <速度> [顆粒數] 顯示顆粒效果。
playsound <音樂/聲效> <玩家名> [x] [y] [z] [音量] [頻率] [最小音量] 播放聲效。
publish 將單人遊戲向局域網玩家開放。
replaceitem <entity | block> 給予實體或方塊物品。
say <信息> 廣播 信息 至所有在線的玩家。(使用明亮的粉紅色字體)
scoreboard <objective | players> 詳細信息請參見計分板條目。
seed 顯示服務器地圖種子。
setblock <x> <y> <z> <方塊名> [數據值] [舊方塊處理方式] [數據標籤] 用於創造,刪除,或代替單個方塊。舊方塊處理方式可為:[ keep | replace | destroy ]
setworldspawn [x] [y] [z] 設置所有玩家的出生點(即使是從未進入服務器的玩家或是不在線的玩家,但不會覆蓋床的設置)。
spawnpoint <玩家名> [x] [y] [z] 將該玩家的出生點移到指定位置。如果該位置沒有定義,那麼“指定位置”就是玩家當前位置。
spreadplayers <x> <z> <分布距離> <最大半徑> <是否採用隊伍> <玩家名> 把玩家分布到一個起始點.能夠定義分散範圍與最小間距。
summon <實體名> [x] [y] [z] [數據標籤] 用於在遊戲中生成任何實體,包括巨人,末影水晶,終界龍,和激活的TNT。
tellraw <玩家名> <原json消息> 運用json語言來在聊天窗口中顯示高級文本(如創造出"按鈕"和格式化文本)。
testfor <玩家名> 測試指定的玩家是否在線或指定玩家是否在指定位置,在1.7.6之前只可以由指令方塊使用。
testforblock <x> <y> <z> <方塊名> [數據值] [數據標籤] 檢測在指定位置的方塊否與指定的方塊相同。
testforblocks <x1> <y1> <z1> <x2> <y2> <z2> [模式] 檢測在指定區域的方塊是否與另一區域的方塊相同。
time set <時間 | day | night> 設置世界時間。時間為0到24000之間的整數,0為凌晨,6000為正午,12000為傍晚,18000為午夜。"time set day"相當於把時間設為1000(舊版為0),"time set night"相當於把時間設為12500(舊版為12000)。
time add <時間> 將世界時間往後撥一段時間。時間必須為自然數。
toggledownfall 更改天氣為下雨或下雪。
tp <目標玩家> 將玩家自己傳送至目標玩家的位置。
tp <玩家名> <目標玩家> 將指定玩家傳送至目標玩家的位置。
tp <玩家名> <x> <y> <z> 將指定玩家傳送到指定位置。如果坐標號前加~,則代表相對坐標。例如/tp John ~3 64 ~3會將ID為John的玩家傳送到他目前的x、z坐標各加3的位置,再將高度調到64。
weather <clear | rain | thunder> <持續秒數> 改變天氣。持續秒數最大為1000000。
xp <數量> <玩家名> 給予該玩家指定數量的經驗。最大數量為2,147,483,647。負數代表減少經驗。數量後加L代表增加指定的等級。

只有多人生存模式可用的命令[編輯]

命令 描述
ban <玩家名稱> 封禁擁有玩家名稱名稱的玩家,列入黑名單,令其永遠無法登進此服務器。 注意:封禁操作會覆蓋之前的白名單操作。
ban-ip <ip 地址> 封禁一個特定的IP,列入黑名單,並從此拒絕任何從該地址而來的連接請求。
banlist [ips] 顯示封禁名單。若要列出封禁的IP,請使用banlist ips指令。
deop <玩家名稱> 撤銷一個玩家的管理員身份。
kick <玩家名稱> 強制斷開玩家名稱與服務器的連接。
list 顯示當前在線的玩家列表。(按Tab ↹也會有同樣的效果)。
op <玩家名稱> 授予 玩家名稱 在服務器里的管理員職位。
pardon <玩家名稱> 玩家名稱 移出黑名單,允許他再次連接到服務器。
pardon-ip <ip地址> ip地址 從IP黑名單移除,允許該IP連接到服務器。
save-all 強制將服務器尚未儲存地變更寫入存檔。
save-off 取消服務器對地圖存檔的寫入。所有的更改都會暫時進入等待隊列。
save-on 允許服務器寫入地圖存檔。這項是默認設定。
setidletimeout <閑置時限(分鐘)> 會自動將掛機過久的玩家踢下線。
stop 正常關閉服務器。
whitelist <add|remove> <玩家名稱> 玩家名稱加進或移出白名單。
whitelist <list> 顯示所有在白名單上的玩家。
whitelist <on|off> 啟用/停用服務器的白名單機制。 注意: 服務器的OP總是能夠在白名單打開時進入服務器,無論他們在與不在白名單上。
whitelist reload 重新從硬盤讀取white-list.txt上的白名單。(當white-list.txt在Minecraft外被更改時可以使用此指令)。

命令列表[編輯]

該表列出了所有可用命令,點擊第一列的命令了解該命令的詳情。

命令列表
命令 描述 OP MP 方塊 實體 玩家 世界
/achievement 獲得/移除玩家的成就。 Op - - - 玩家 -
/ban 添加一個玩家到黑名單中。 Op MP - - 玩家 -
/ban-ip 添加一個IP地址到黑名單中。 Op MP - - 玩家 -
/banlist Displays banlist. Op MP - - 玩家 -
/blockdata Modifies the data tag of a block. Op - 方塊 - - -
/clear Clears items from player inventory. Op - - - 方塊 -
/clone Copies blocks from one place to another. Op - 方塊 - - -
/debug Starts or stops a debugging session. Op - - - - -
/defaultgamemode Sets the default game mode. Op - - - - 世界
/deop Revoke operator status from a player. Op MP - - 玩家 -
/difficulty Sets the difficulty level. Op - - - 玩家 -
/effect Add or remove status effects. Op - - 實體 玩家 -
/enchant Enchants a player item. Op - - - 玩家 -
/entitydata Modifies the data tag of an entity. Op - - 玩家 - -
/execute Executes another command. Op - - - - -
/fill Fills a region with a specific block. Op - 方塊 - - -
/gamemode Sets a player's game mode. Op - - - 玩家 -
/gamerule Sets or queries a game rule value. Op - - - - 世界
/give Gives an item to a player. Op - - - 玩家 -
/help Provides help for commands. - - - - - -
/kick Kicks a player off a server. Op MP - - 玩家 -
/kill Kills entities (players, mobs, items, etc.). Op - - 實體 玩家 -
/list Lists players on the server. Op MP - - 玩家 -
/me Displays a message about yourself. - - - - 玩家 -
/op Grants operator status to a player. Op MP - - 玩家 -
/pardon Removes entries from the banlist. Op MP - - 玩家 -
/particle Creates particles. Op - - - 玩家 -
/playsound Plays a sound. Op - - - 玩家 -
/publish Opens single-player world to local network. Op - - - - 世界
/replaceitem Replaces items in inventories. Op - 方塊 實體 玩家 -
/save-all Saves the server to disk. Op MP - - - 世界
/save-off Disables automatic server saves. Op MP - - - 世界
/save-on Enables automatic server saves. Op MP - - - 世界
/say Displays a message to multiple players. - - - - 玩家 -
/scoreboard Manages objectives, players, and teams. Op - - 實體 玩家 -
/seed Displays the world seed. Op - - - - 世界
/setblock Changes a block to another block. Op - 方塊 - - -
/setidletimeout Sets the time before idle players are kicked. Op MP - - 玩家 -
/setworldspawn Sets the world spawn. Op - - - - 世界
/spawnpoint Sets the spawn point for a player. Op - - - 玩家 -
/spreadplayers Teleports entities to random locations. Op - - 實體 玩家 -
/stats Update objectives from command results. Op - 方塊 實體 玩家 -
/stop Stops a server. Op MP - - - 世界
/summon Summons an entity. Op - - 實體 - -
/tell Displays a private message to other players. - - - - 玩家 -
/tellraw Displays a JSON message to players. Op - - - 玩家 -
/testfor Counts entities matching specified conditions. Op - - 實體 玩家 -
/testforblock Tests whether a block is in a location. Op - 方塊 - - -
/testforblocks Tests whether the blocks in two regions match. Op - 方塊 - - -
/time Changes or queries the world's game time. Op - - - - 世界
/title Manages screen titles. Op - - - 玩家 -
/toggledownfall Toggles the weather. Op - - - - 世界
/tp Teleports entities. Op - - 實體 玩家 -
/trigger Sets a trigger to be activated. Op - - - 玩家 -
/weather Sets the weather. Op - - - - 世界
/whitelist Manages server whitelist. Op MP - - 玩家 -
/worldborder Manages the world border. Op - - - - 世界
/xp Adds or removes player experience. Op - - - 玩家 -

命令列表[編輯]

格式
若你看到… 那麼
純文本 Enter this literally,完全如所示的。
斜體 用一個適當的值替換此項
<尖括號> 這是一項必需參數
[方括號] 這是一項可選參數
x|y

Pick one of the options shown.

可選項被垂直線隔開列出: |

ellipsis … The argument may consist of multiple words separated by spaces.
Success Conditions
A command's Success Conditions must be met in order for the game to consider the command "successful". This is used to determine a variety of things, such as the output of a redstone comparator feeding from command block with a command. Note that not all "successful" commands actually do something, and not all "failed" commands fail to do something useful.
Restrictions
Describes restrictions on who can use the command or in what context.
  • None: The command can be used by any player in any world. The following commands have no restrictions: /help, /me, /tell, and /trigger.
  • Operator: The command may only be used by an operator or in singleplayer mode with cheats enabled. On multiplayer servers, the results of these commands are broadcast to other ops online.
No multiplayer commands permit target selectors in arguments and, except for /list, multiplayer commands cannot be used in command blocks. Many of these commands can be used on players who have never been to the server, or even on names which are not (or cannot be) registered as Minecraft accounts.
  • No command blocks: The command cannot be executed by a command block.


achievement[編輯]

achievement
限制條件

僅限服務器管理員

第一次發布

1.7.2 (13w36a)

給予一位玩家一項成就或increases a statistic.

格式
achievement <give|take> <stat_name|*> [玩家]
參數
stat_name
Must be either:
  • achievement.achievement_name, where achievement_name is a valid achievement identifier
  • stat.statistic_name, where statistic_name is a valid statistic identifier
  • * to represent all achievements
玩家 (可選)
必須為一個玩家名或 a target selector。若未指定,默認為命令執行者。在指令方塊中為必需項。
結果
若參數指定不正確則失敗, or if 玩家 fails to resolve to one or more online players.
若成功,給予或移除特定成就(and all prerequisite achievements) to the player(s) or increases/decreases the specified statistic of the player(s) by 1.
例子
給予你自己"Overkill"成就: achievement give achievement.overkill
給予Alice"Taking Inventory"成就: achievement give achievement.openInventory Alice
To increase the "Mob Kills" statistic by 1 for the nearest player: achievement give stat.mobKills @p
清除所有玩家的所有成就: achievement take * @a
另見
Commands to modify player:


ban[編輯]

These commands manage a server banlist. The server banlist is a list of players or IP addresses that will not be allowed to connect to the server. Bans supersede any whitelisting in place.

另見:/whitelist


ban[編輯]

ban
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Alpha 1.0.16

Adds player to banlist.

格式
ban <名字> [原因 …]
參數
名字
The name of the player to be banned. Does not need to be online, or even real.
原因 (可選)
Text to be displayed with the ban, to other operators and in the server logs.
結果
Always succeeds. The player name is added to the server banlist which prevents anyone from connecting to the server by that name.


ban-ip[編輯]

ban-ip
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Alpha 1.0.16

Adds IP address to banlist.

格式
ban-ip <address|name> [原因 …]
參數
address|name
必須為一個玩家名或一個IP地址。
原因 (可選)
Text to be displayed with the ban, to other operators and in the server logs.
結果
Fails if address|name is neither a valid IP address nor the name of an online player.
若成功, the IP address (of the online player, or the address specified) is added to the server banlist which prevents anyone from connecting to the server from that address.


banlist[編輯]

banlist
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Alpha 1.0.16

Displays banlist.

格式
banlist ips
banlist players
結果
總是成功。 Displays banned IP addresses or banned players.


blockdata[編輯]

blockdata
限制條件

僅限服務器管理員

第一次發布

1.8 (14w02a)

Modifies the data tag of a block.

格式
blockdata <x> <y> <z> <dataTag>
參數
x y z
指定要修改的方塊的坐標。 May be provided in tilde notation to identify a position relative to the command's execution.
dataTag
指定data tag elements to be added to, or overwrite elements of, the specified block. Must be a compound NBT tag (for example, {CustomName:Fred}).
結果
若參數指定不正確則失敗。
若成功, modifies the data tag of the targeted block.
例子
To change the primary power of the beacon at (0,64,0) to Haste:
blockdata 0 64 0 {Primary:3}
另見


clear[編輯]

clear
限制條件

僅限服務器管理員

第一次發布

1.4.2 (12w37a)

Clears items from player inventory.

格式
clear [玩家] [item] [data] [最大数量] [dataTag]
參數
玩家 (可選)
必須為一個玩家名或一個target selector。若未指定,默認為命令使用者。在指令方塊中為必需項。
item data (可選)
Specifies the id and data of the item to be cleared. If neither argument is specified, clears all items from the inventory. If item is specified, but not data, all items with id item are cleared, regardless of their data. data can be set to -1 to ignore data and clear all blocks of a certain id when maxCount or dataTag must be specified but data needs to be ignored.
最大數量 (可選)
指定物品被清除的最大數量。若未指定,或為-1,清除所有物品。若為0,不清除物品, but returns successfully if there were items that could have been cleared (allowing detection of items rather than clearing of items).
dataTag (可選)
Specifies the data tags of the item to be cleared (only items matching the specified data tags will be cleared — data tags not specified will not be considered). Must be a compound NBT tag (for example, {display:{Name:Fred}}).
結果
若參數指定不正確則失敗,如果玩家 fails to resolve to one or more online players, or if no items are removed.
若成功,移除玩家的特定物品。
例子
清除所有物品: clear
清除Alice的所有物品: clear Alice
清除Alice身上的所有羊毛(無視顏色): clear Alice minecraft:wool
清除所有玩家的橘色羊毛(僅限橙色): clear @a minecraft:wool 1
清除離你最近的玩家身上帶有“鋒利I”的金劍(無視這把劍的耐久):
clear @p minecraft:golden_sword -1 -1 {ench:[{id:16s,lvl:1s}]}
另見
/give — 給予玩家物品


clone[編輯]

clone
限制條件

僅限服務器管理員

第一次發布

1.8 (14w03a)

將方塊從一個區域克隆至另一個。

格式
clone <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [屏蔽模式] [克隆模式] [TileName]
The in-game help for the clone command does not list the final argument. TileName is a placeholder name for the purpose of discussion.
參數
x1 y1 z1x2 y2 z2
指定被克隆區域(“源區域”)的任意兩對角。可以使用tilde notation 來指定一段相對於命令執行位置的距離。
構成角的方塊在它們坐標的正方向上延伸。因此,各軸上較小的坐標將會正好符合區域邊界,但較大的坐標將會超過邊界一個方塊,and the block volume of the source region will be (xgreater - xlesser + 1) × (ygreater - ylesser + 1) × (zgreater - zlesser + 1). For example, 0 0 0 0 0 0 has a 1-block volume, and 0 0 0 1 1 1 and 1 1 1 0 0 0 both identify the same region with an 8-block volume.
x y z
指定克隆區域(“目標區域”)的下西北角(即,各軸的最小坐標)。可以使用tilde notation 來指定一段相對於命令執行位置的距離。
屏蔽模式 (可選)
必須是其中之一:
  • filtered — 僅克隆擁有特定方塊ID的方塊(見下文的TileName)。
  • masked — 僅克隆非空氣方塊。否則目標區域內的方塊將會被源區域內的空氣方塊覆蓋。
  • replace — 克隆所有方塊,用源區域的方塊覆蓋目標區域的“所有”方塊。
若未指定,默認為replace.
克隆模式 (可選)
必須是其中之一:
  • force — 強制克隆,甚至當源區域與目標區域重疊時。
  • move — 克隆源區域至目標區域,然後將被克隆的方塊替換為空氣。當在屏蔽模式filtered下使用時,僅被克隆的方塊會被空氣替換。
  • normal — 非move或force。 當需要指定“TileName”時使用。
若未指定,默認為normal.
TileName (可選)
指定使用屏蔽模式filtered時克隆的方塊ID(例如, minecraft:stone)。當使用屏蔽模式filtered時必選。
結果
若參數指定不正確則失敗, if the block volume of the source region is greater than 32768 (enough for the equivalent of eight chunk sections), if the source and destination region overlap (unless using force clone mode), or if one or both regions isn't currently rendered.
若成功, overwrites blocks in the destination region with blocks from the source region, leaving the source region unmodified (除非使用克隆模式move)。
另見
/fill — 用一種方塊填充一個區域


debug[編輯]

debug
限制條件

僅限服務器管理員
不能在指令方塊上使用

第一次發布

1.3.1 (12w27a)

Starts or stops a debugging session.

格式
debug <start|stop>
參數
start
Starts a new debug profiling session.
stop
Stops the active debug profiling session.
結果
Fails if tried to start a debug session when one is already active, or if tried to stop a debug session when none is running.
若成功, starts or stops the debug session. While active, includes notifications about potential performance bottlenecks in the console. When stopped, creates a profiler results file in the folder "debug".


defaultgamemode[編輯]

defaultgamemode
限制條件

僅限服務器管理員

第一次發布

1.3.1 (12w22a)

Sets the default game mode (creative, survival, etc.) for new players entering a multiplayer server.

格式
defaultgamemode <模式>
參數
模式
必須為其中之一:
"極限模式"不是一個有效的模式參數選項,因其技術上不是一個遊戲模式。
結果
若參數指定不正確則失敗。
若成功, sets the default game mode that is shown on the world selection menu. 加入世界的新玩家將會被置於默認的遊戲模式。
例子
設定默認遊戲模式為生存: defaultgamemode survival, defaultgamemode s,或defaultgamemode 0
另見
/gamemode – 更改一位玩家的遊戲模式


deop[編輯]

deop
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Alpha 1.0.16

Revoke operator status from a player.

格式
deop <玩家>
參數
玩家
指定一個玩家從operators列表中移除。 May be anything but target selectors will not evaluate and only actual player names will produce a useful result.
結果
Always succeeds if restrictions are satisfied. If player matches a name on the list of operators, the name is removed from the list and any player by that name no longer has operator status.
例子
將Alice從operators列表中移除: deop Alice


difficulty[編輯]

difficulty
限制條件

僅限服務器管理員

第一次發布

1.4.2 (12w32a)

設定難度等級(和平,簡單,等。)。

格式
difficulty <新难度>
參數
新難度
必須為其中之一:
  • peaceful (可被簡寫為p0)為peaceful difficulty
  • easy (可被簡寫為e1)為easy difficulty
  • normal (可被簡寫為n2)為normal difficulty
  • hard (可被簡寫為h3)為hard difficulty
"極限模式"不是一個有效的新難度參數選項,因其不是一個難度。
結果
若參數指定不正確則失敗。
若成功,更改遊戲的難度。On a multiplayer server lasts only until the server is restarted — on restart, difficulty is reloaded from server.properties.
例子
更改難度為困難: difficulty hard, difficulty h,或difficulty 3
另見
/gamemode – 更改一位玩家的遊戲模式(創造,生存,等。)


effect[編輯]

effect
限制條件

僅限服務器管理員

第一次發布

1.5 (13w09b)

命令effect管理玩家及其它實體上的狀態效果

格式
effect <玩家> clear (移除所有效果)
effect <玩家> <效果> [秒数] [倍率] [隐藏粒子] (給予一種效果)
參數
玩家
指定目標(們)。必須是一位玩家的名字或一個target selector (@e is permitted to target entities other than players).
效果
指定給予的效果。必須是一個status effect id (例如, 1minecraft:speed).
秒數 (可選)
以秒為單位指定效果時長。必須在0至1000000(包含)間。若未指定,默認為30秒。
倍率 (可選)
Specifies the number of additional levels to add to the effect. 必須在0至255(包含)間。若未指定,默認為0。
隱藏粒子 (可選)
指定是否particles of the status effect should be hidden。必須為truefalse。若未指定,默認為false
結果
若參數指定不正確則失敗,若玩家 fails to resolve to one or more valid entities (named players must be online), if seconds was specified as 0 and the target did not have the effect, or if no effects were removed in clear mode.
若成功:
  • clear — 從目標(們)身上清除所有狀態效果。
  • 效果 — Adds the status effect to the target(s). 如果一個目標已經擁有狀態效果, a new status effect with the same amplifier will only override the old duration if it is longer, but a new status effect with a higher duration will override any previous duration. If seconds is set to 0, cancels the specified effect instead.
例子
給予最近的玩家一個60秒的速度1效果: effect @p 1 60
給予最近的玩家一個60秒的速度3效果: effect @p 1 60 2
To clear any Haste effects from all players: effect @a 3 0
清除所有殭屍身上的所有效果: effect @e[type=Zombie] clear


enchant[編輯]

enchant
限制條件

僅限服務器管理員

第一次發布

1.4.4 (1.4.4-pre)

給一位玩家選中的物品添加附魔。

格式
enchant <玩家> <附魔ID> [等级]
參數
玩家
指定目標(們)。必須是一個玩家名或target selector
附魔ID
指定添加至玩家手持物品的附魔。必須是一個有效的enchantment ID (例如, 16minecraft:sharpness).
等級 (可選)
指定附魔等級。必須至少為1且不大於特定附魔的maximum level。若未指定,默認為1。
結果
若參數指定不正確則失敗,若玩家 fails to resolve to one or more online players, or if the enchantment is not valid for the item or conflicts with current enchantments (for example, "Fire Protection" cannot be given to armor which already has "Protection", and "Sharpness III" cannot be given to a sword which already has "Sharpness I").
若成功,添加指定的附魔至目標的手持物品。
例子
給所有手持弓的玩家附魔無限: enchant @a 51


entitydata[編輯]

entitydata
限制條件

僅限服務器管理員

第一次發布

1.8 (14w32b)

Modifies the data tag of an entity.

格式
entitydata <实体> <dataTag>
參數
實體
指定修改的實體。Must be an entity UUID or the @e target selector.
dataTag
Specifies the data tag elements to be added to, or overwrite elements of, the specified entity. Must be a compound NBT tag (例如, {CustomName:Fred}).
結果
若參數指定不正確則失敗, or if 實體 fails to resolve to one or more non-player entities (players can not be changed).
若成功, modifies the data tag of the targeted entity(ies).
例子
阻止所有現有殭屍撿拾物品:
entitydata @e[type=Zombie] {CanPickUpLoot:0}


execute[編輯]

execute
限制條件

僅限服務器管理員

第一次發布

1.8 (14w07a)

Executes a command with a different user and position.

格式
execute <实体> <x> <y> <z> <命令 …>
An alternate syntax allows the command to be executed only if a specific block is detected:
execute <实体> <x> <y> <z> detect <x2> <y2> <z2> <方块> <data> <命令 …>
參數
實體
Specifies the target to be the command's executor. 必須為一個玩家名或target selector.
x y z
Specifies the position from which to run the command. x and z must be within the range -30,000,000 to 30,000,000 (inclusive). May use tilde notation to specify distances relative to the target.
命令
指定要運行的命令必須為一個有效命令。
x2 y2 z2 (僅在detect模式可用)
Specifies the position of the block to check. x2 and z2 must be within the range -30,000,000 to 30,000,000 (inclusive). May use tilde notation to specify distances relative to (x,y,z).
方塊 and data (僅在detect模式可用)
Specifies the block id and data which the block at (x2,y2,z2) must match for the command to run. block must be a valid block id (for example, minecraft:stone), and data must be a valid block data for that type of block or -1 to match any block data.
結果
若參數指定不正確則失敗, if 實體 fails to resolve to one or more valid entities (named players must be online), if the checked block is not of the correct block id and data, or if the specified command fails.
若成功, executes the specified command as if executed by the specified target(s) with operator-level permission at the specified coordinate.
例子
在每個殭屍的位置生成閃電:
execute @e[type=Zombie] ~ ~ ~ summon LightningBolt
在每個站在任意種類沙上的殭屍的位置生成閃電:
execute @e[type=Zombie] ~ ~ ~ detect ~ ~-1 ~ minecraft:sand -1 summon LightningBolt
另見
/testforblock — 檢測一個特定位置的某個方塊(including specific data tags)


fill[編輯]

fill
限制條件

僅限服務器管理員

第一次發布

1.8 (14w03a)

用特定方塊全部或部分填充一個區域。

格式
fill <x1> <y1> <z1> <x2> <y2> <z2> <TileName> [dataValue] [oldBlockHandling] [dataTag]
The fill command also has an optional alternate syntax when using the replace option:
fill <x1> <y1> <z1> <x2> <y2> <z2> <TileName> <dataValue> replace [replaceTileName] [replaceDataValue]
參數
x1 y1 z1 and x2 y2 z2
Specifies any two opposing corner blocks of the region to be filled (the "fill region"). May use tilde notation to specify distances relative to the command's execution.
The blocks that make up the corners extend in the positive direction from the coordinates used to identify them. Because of this, the lesser coordinates of each axis will be right on the region boundary, but the greater coordinates will be one block from the boundary, and the block volume of the source region will be (xgreater - xlesser + 1) × (ygreater - ylesser + 1) × (zgreater - zlesser + 1). For example, 0 0 0 0 0 0 has a 1-block volume, and 0 0 0 1 1 1 and 1 1 1 0 0 0 both identify the same region with an 8-block volume.
TileName
Specifies the block to fill the region with. Must be a block id (for example, minecraft:stone).
dataValue (optional)
Specifies the block data to use for the fill block. Must be between 0 and 15 (inclusive).
oldBlockHandling (optional)
Must be one of:
  • destroy - Replaces all blocks (including air) in the fill region with the specified block, dropping the replaced blocks and block contents as entities as if they had been mined.
  • hollow - Replaces only blocks on the outer edge of the fill region with the specified block. Inner blocks are changed to air, dropping their contents as entities but not themselves.
  • keep - Replaces only air blocks in the fill region with the specified block.
  • outline - Replaces only blocks on the outer edge of the fill region with the specified block. Inner blocks are not affected.
  • replace - Replaces all blocks (including air) in the fill region with the specified block, without dropping blocks or block contents as entities. Optionally, instead of specifying a data tag for the replacing block, block id and data values may be specified to limit which blocks are replaced (see replaceTileName and replaceDataValue below)
If not specified, defaults to replace.
dataTag (可選)
Specifies the data tag to use for the fill block (for example, contents of a chest, patterns on a banner, etc.). Must be a compound NBT tag (for example, {CustomName:Fred}). Cannot be combined with the replaceTileName and replaceDataValue arguments.
replaceTileName replaceDataValue (可選)
Arguments are only valid when oldBlockHandling is replace. Cannot be combined with the dataTag argument.
Specifies the block id and data of the blocks in the fill region to be replaced. If replaceDataValue is not specified, data value is ignored when determining which blocks to replace. If both arguments are not specified, replaces all blocks in the fill region.
結果
若參數指定不正確則失敗, if the fill region is not rendered, if the block volume of the fill region is greater than 32768, if dataValue or dataTag are invalid for the specified block id, or if no blocks were changed.
若成功,將填充區域內的方塊更改為特定方塊。


gamemode[編輯]

gamemode
限制條件

僅限服務器管理員

第一次發布

1.3.1 (12w16a)

設定一個玩家的game mode.

格式
gamemode <模式> [玩家]
參數
模式
必須為其中之一:
"極限模式"不是一個有效的模式參數選項,因其技術上不是一個遊戲模式。
玩家 (可選)
若指定,必須是一位玩家的用戶名或一個target selector。若未指定,默認為使用命令的玩家。當在指令方塊中使用,玩家為必需項。
結果
若參數指定不正確則失敗, or if 玩家 fails to resolve to one or more online players.
若成功,更改默認的或指定的玩家遊戲模式。
例子
使你進入創造模式: gamemode creative, gamemode c,或gamemode 1
使所有玩家進入生存模式: gamemode 0 @a
另見
defaultgamemode – 設定加入世界玩家的初始遊戲模式


gamerule[編輯]

gamerule
限制條件

僅限服務器管理員

第一次發布

1.4.2 (12w32a)

設置或查詢一條遊戲規則值。

格式
gamerule <规则名> []
參數
規則名
指定了要設置或查詢的遊戲規則。可為任何值,但只有某些預設的遊戲規則會影響遊戲玩法(見下預設遊戲規則)。
(可選)
指定將遊戲規則設置的值。可為任何值,但只有truefalse指定預設的遊戲規則會真正影響遊戲玩法,除了randomTickSpeed的情況下,任何0或以上的數字將會影響遊戲玩法(見下預設遊戲規則)。
預設遊戲規則
規則名 描述 默認值
commandBlockOutput command block是否在執行命令時通知管理員 true
doDaylightCycle 時間是否演進 true
doEntityDrops 非生物实体是否掉落 true
doFireTick 火是否傳播及自然熄滅 true
doMobLoot 生物是否掉落物品 true
doMobSpawning 生物是否自然生成 true
doTileDrops 方塊是否掉落 true
keepInventory 玩家是否在死後保存物品欄內的物品 false
logAdminCommands Whether to log admin commands to server log true
mobGriefing 苦力怕,殭屍,終界使者,地獄幽靈,凋零怪,兔子,,及村民是否能改變方塊及村民, 殭屍, 骷髏,及殭屍豬人是否能撿拾物品 true
naturalRegeneration 玩家是否能在飢餓值足夠時自然恢復生命值(不影響外部的治療,例如金蘋果, the Regeneration effect,等。) true
randomTickSpeed How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick. 0 will disable random ticks, higher numbers will increase random ticks 3
reducedDebugInfo Whether the debug screen shows all or reduced infomation false
sendCommandFeedback Whether the feedback from commands executed by a player should show up in chat. Also affects the default behavior of whether command blocks store their output text true
showDeathMessages 當一位玩家死亡時是否在聊天框中出現一條信息 true
結果
Fails if rule name is not defined and value is not provided (i.e., attempting to query an undefined game rule).
On success, returns the value of the game rule (if value is not provided) or sets the game rule to the specified value (if value is provided).
可定義新遊戲規則及設值(通過給出一個值)或查詢(通過不給出一個值)。
例子
停止日夜交替: gamerule doDaylightCycle false
停止自然恢復: gamerule naturalRegeneration false
定義一條叫MyNewRule的新遊戲規則並將其值設為10: gamerule MyNewRule 10


give[編輯]

give
限制條件

僅限服務器管理員

第一次發布

1.3.1 (12w16a)

給一位玩家一種物品。

格式
give <玩家> <物品> [数量] [data] [dataTag]
參數
玩家
指定給予物品的目標。必須為一個玩家名或目標選擇器
物品
指定給予的物品。必須為一個可用的item id (例如, 256minecraft:iron_shovel),或block id for which items exist.
數量 (可選)
指定給予的物品數量。必須在1及64間(包含)。若未指定,默認為1
data (可選)
Specifies the item data of the given item(s). Must be an integer between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas), but values which are invalid for the specified item id default to 0. If not specified, defaults to 0.
dataTag (optional)
Specifies the data tag of the given item(s). Must be a compound NBT tag (for example, {display:{Name:Fred}}).
結果
若參數指定不正確則失敗, or if player fails to resolve to one or more online players.
若成功, summons the specified item(s) at the location(s) of the target(s). If player resolves to multiple targets, each receives the specifed number of items. The item entity's Owner tag is set to the target and its PickupDelay tag set to 0Template:Verify so the item can be picked up immediately and only by the target (if the target has room in their inventory).
例子
To summon 30 blocks of spruce wood planks at John's location with Lore that says "Wooden planks":
give John minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}}
另見
/summon — 在任意位置生成任何實體


help[編輯]

help
限制條件

第一次發布

1.3.1 (12w17a)

提供命令的幫助。

格式
help [页数|命令名]
? [页数|命令名]
參數
頁數|命令名 (可選)
指定命令列表的頁數或提供幫助的命令。若未指定,默認為1(命令列表的第一頁)。
結果
頁數不是一個可用頁數則失敗,或當命令名不是一個可用命令名。甚至當指定一個可用的命令名時技術上是失敗的,雖然它顯示了該命令的用法。
若成功,顯示命令列表的一頁。多人命令不會在單人模式下顯示, even when open to LAN players.
若指定了一個可用的命令名,顯示該命令的用法。 For some complicated commands may show only the basic usage — additional information can sometimes be gained by attempting to type the command and using the auto-complete control (默認為Tab ↹鍵) to explore 每個參數的可用選項。
例子
顯示命令列表的第一頁: ?help
顯示命令列表的第三頁: ? 3
顯示命令help的用法: help help


kick[編輯]

kick
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Alpha 1.0.16

Kicks a player off a server.

Syntax
kick <player> [reason …]
Description
Forcibly disconnects player from the server, displaying an optional reason to them.
Success Conditions
player must be online.


kill[編輯]

kill
限制條件

僅限服務器管理員

第一次發布

1.3.1 (12w16a)

Kills entities (players, mobs, items, etc.).

Syntax
kill [player|entity]
Arguments
player|entity
Specifies the target(s) to be killed (including "non-living" entities like items, vehicles, etc.). Must be a player name or a target selector. If not specified, defaults to the command's user. Not optional in command blocks.
Result
Fails if player|entity fails to resolve to one or more entities (named players must be online).
On success, inflicts 1000 (Heart.svg × 500) void damage to targets — killing them instantly even if in Creative mode or protected by a high-level Resistance effect — and issues the appropriate death message. Players and mobs killed this way drop loot, and slimes and magma cubes that aren't already of minimum size spawn smaller ones. Destroys boats, minecarts, loose items and experience orbs if they are targeted.
Examples
To kill yourself: kill
To kill Bob: kill Bob
To "kill" all item entities (making them vanish from the world): kill @e[type=Item]


list[編輯]

list
限制條件

僅限多人遊戲
僅限服務器管理員

第一次發布

Alpha 1.0.16_02

Lists players on the server.

Syntax
list
Description
Shows the names of all currently-connected players (the same can be achieved when pressing tab)
Success Conditions
Always succeeds, even in a command block.


me[編輯]

me
限制條件

第一次發布

Classic 0.0.15a_03

Displays a message about yourself.

Syntax
me <action …>
Description
Sends a narrative message to the other players in the form of "* Yourname action" (e.g., "* Alice sneezes." or "* Alice exploded." ). If a multi-person target selector (e.g., @a) is used in action, the list of names is formatted as "name1, name2, and name3", or "name1 and name2" for two names. Therefore, regardless of any target selectors which are used in action, this command will only output once.
Success Conditions
All target selectors (e.g., @p) in action must evaluate.


op[編輯]

op
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Alpha 1.0.16

Grants operator status to a player.

Syntax
op <player>
Description
Grants player operator status on the server.
Success Conditions
Always succeeds.


pardon[編輯]

pardon, pardon-ip
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Alpha 1.0.16

Removes entries from the banlist.

Syntax
pardon <name>
pardon-ip <address>
Arguments
name
Specifies the name to remove from the banlist.
address
Specifies the IP address to remove from the banlist. Must be a valid IP address.
Result
Fails if arguments are not specified properly.
On success, if the name or the IP address is on the banlist, it is removed, allowing anyone to connect to the server by that name or from that IP address.


particle[編輯]

particle
限制條件

僅限服務器管理員

第一次發布

1.8 (14w04a)

Creates particles.

Syntax
particle <name> <x> <y> <z> <xd> <yd> <zd> <speed> [count] [mode]
Arguments
name
Specifies the particle to create. Must be a particle name (for example, explode).
x y z
Specifies the position at which to create the particle. All values (including y) must be between -30,000,000 and 30,000,000 (inclusive, without the commas). May use tilde notation to specify a position relative to the command's execution.
xd yd zd
Specifies the size of the area to spawn particles in.
Exception: When name is reddust, mobSpell, or mobSpellAmbient and count is 0 or not specified, specifies the color of the particle in RGB format offset from the particle's default color (reddust's default is a near-red (a random red tint between 0.8 and 1.0), while the others default to black). For example, with reddust, 0 0 0 produces a red particle, -1 1 0 produces a green particle (red is reduced to 0 and green increased to 1), 0 0 1 produces a purple particle (blue is added to the original red), etc. With mobSpell or mobSpellAmbient, 0 0 0 produces a black particle, 0 1 0 produces a green particle, 0 0 0.5 produces a dark blue particle, etc. If count is greater than 0, colors are randomized.
speed
Specifies the speed of the particle. Must be at least 0.
count (optional)
Specifies the number of particle effects to create. Must be at least 0 (which produces one particle).
mode (optional)
Specifies the display mode. May be anything but only force will have an effect: to allow the particle(s) to be seen beyond the usual 16 block radius.
Result
Fails if arguments are not specified properly.
On success, creates the specified particle.
Examples
To create a stationary huge explosion particle 10 blocks to the east:
particle hugeexplosion ~10 ~ ~ 0 0 0 0


playsound[編輯]

playsound
限制條件

僅限服務器管理員

第一次發布

1.6.1 (1.6.1-pre)

Plays a sound.

Syntax
playsound <sound> <player> [x] [y] [z] [volume] [pitch] [minimumVolume]
Arguments
sound
Specifies the sound to play. Must be a sound event defined in sounds.json (for example, mob.pig.say).
A sound event may be affiliated with multiple sounds, and the sound which is actually produced will be chosen at random from them, modified by their "weight", just as the game normally would. For example, the mob.pig.say sound event will play one of several pig sounds at random, because the event has multiple sounds associated with it.
Resource packs may add their own events to sounds.json; the command will successfully play these. File names are not used by this command; it strictly uses the events defined in sounds.json (which may not even be similar to the original file names and paths), and thus a resource pack adding new sound files must define events for them (this is not necessary when replacing old sounds which are already in defined events).
player
Specifies the sound's target. Must be a player name or a target selector.
x y z (optional)
Specifies the position to play the sounds from. May use tilde notation to specify a position relative to the target(s).
volume (optional)
Specifies the distance that the sound can be heard. Must be at least 0.0. For values less than 1.0, the sound will be quieter and have a smaller sphere within which it may be heard. For values greater than 1.0, the sound will not actually grow louder, but its audible range (a 16-block radius at 1.0) will be multiplied by volume. There will always be a gradual falloff to silence based on distance from the center of the sphere.
pitch (optional)
Specifies the pitch of the sound. Must be between 0.0 and 2.0 (inclusive), and values less than 0.5 are equivalent to 0.5. Values lower than 1.0 lower the pitch and increase the duration; values greater than 1.0 raise the pitch and reduce the duration. The pitch value is a multiplier applied to the frequency, so if a value between 0.5 and 1.0 (inclusive) is doubled, the pitch will be an octave higher. (If you're a musician wishing to convert other intervals to pitch values, see Note block#Usage, but be aware that 1.0 won't be F♯ for all sound effects.) If not specified, defaults to 1.0.
minimumVolume (optional)
Specifies the volume for targets outside the sound's normal audible sphere. If a target is outside the normal sphere, the sound will instead be centered some short distance from the target (less than four blocks away), and minimumVolume will determine its volume. Must be between 0.0 and 1.0 (inclusive).
Result
Fails if arguments are not specified properly, if player fails to resolve to one or more online players, or if the targets are unable to hear the sound from where it is played.
On success, plays a sound for the targeted players.


publish[編輯]

publish
限制條件

僅限服務器管理員
不能在指令方塊上使用

第一次發布

1.3.1 (12w24a)

Opens single-player world to the local network.

Syntax
publish
Description
Opens your single-player game for LAN friends to join. This command appears in the singleplayer cheats.
Success Conditions
Cannot be used in a command block.


replaceitem[編輯]

replaceitem
限制條件

僅限服務器管理員

第一次發布

1.8 (14w26a)

Replaces items in the inventories of blocks (chest, furnaces, etc.) or entities (players or mobs) with the given item(s).

Syntax
replaceitem block <x> <y> <z> <slot> <item> [amount] [data] [dataTag]
replaceitem entity <selector> <slot> <item> [amount] [data] [dataTag]
Arguments
x y z (block mode only)
Specifies the position of the block to be modified. May use tilde notation to specify a position relative to the command's execution.
selector (entity mode only)
Specifies the entity to modify. Must be a player name or target selector.
slot
Specifies the inventory slot to be modified. Valid values depend on whether a block or an entity is being modified.
For blocks, must be slot.container.slot_number where slot_number is replaced with a number specifying the slot.
  • Chests, dispensers, droppers, hoppers, and trapped chests are numbered 0 for the top-left slot and then increase first horizontally, then vertically (so, for example, a chest's top row slots are numbered 0 to 8 from left to right). Double chests and double trapped chests are treated as two single container blocks.
  • A brewing stand's bottom slots are numbered 0 to 2 from left to right, and its top slot is 3.
  • A furnace's slots are numbered 0 for the input slot, 1 for the fuel slot, and 2 for the output slot.
Other blocks which hold items but don't have inventory GUIs (flower pots and jukeboxes) can only be changed with /blockdata.
For entities, must be one of the following, where slot_number is replaced with a number specifying the slot:
Slot Slot Numbers Restrictions
slot.armor.chest armor stands, mobs, and players only (though not all mobs will show or make use of the items)
slot.armor.feet
slot.armor.head
slot.armor.legs
slot.weapon armor stands and mobs only (though not all mobs will show or make use of the items)
slot.enderchest.slot_number 0 to 26 players only
slot.hotbar.slot_number 0 to 8
slot.inventory.slot_number 0 to 26
slot.horse.saddle horses, donkeys, and mules only; item must be a saddle
slot.horse.armor horses only; item must be a type of horse armor
slot.horse.chest.slot_number 2 to 16 donkeys and mules with chests only
slot.villager.slot_number 0 to 7 villagers only
The inventory of an item frame can only be changed with /entitydata.
item
Specifies the item to be placed in the block or entity's inventory slot. Must be an item id, or a block id for which an item exists (for example, minecraft:golden_sword).
amount (optional)
Specifies the number of items to be placed in the block or entity's inventory slot. Must be between 1 and 64 (inclusive), even for items with a smaller stack size.
data (optional)
Specifies the item data for the item(s) to be placed in the block or entity's inventory slot. Must be an integer between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas), but values which are invalid for the specified item id will default to 0. If not specified, defaults to 0.
dataTag (optional)
Specifies the data tag for the item(s) to be placed in the block or entity's inventory slot. Must be a compound NBT tag (for example, {display:{Name:Fred}}).
Result
Fails if arguments are not specified properly, if the specified block is not a container, if selector fails to resolve to one or more entities (named players must be online), or if the targeted entity does not have the specified slot (for example, zombies don't have slot.horse.armor).
On success, replaces the items in the specified slot with the specified items (previous items in that slot are lost).
Examples
To replace the items in the bottom-right slot of a single chest one block above with four spruce saplings:
replaceitem block ~ ~1 ~ slot.container.26 minecraft:sapling 4 1
To replace the items in the rightmost hotbar slot of the nearest player with four spruce saplings:
replaceitem entity @p slot.hotbar.8 minecraft:sapling 4 1
See also
/blockdata — can also replace items in a container
/entitydata — can also replace items in a mob's inventory, or modify the drop chances of armor and weapons
/give — give items to players without specifying specific inventory slots or overwriting other items


save[編輯]

save
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Alpha 1.0.16_01

These commands manage server saves.


save-all[編輯]

Saves the server to disk.

Syntax
save-all
Description
Forces the server to write all pending changes to the world and player data to disk.
Success Conditions
Always succeeds.


save-off[編輯]

Disables automatic server saves.

Syntax
save-off
Description
Disables the server writing to the world files. All changes will temporarily be queued.
Success Conditions
Always succeeds.


save-on[編輯]

Enables automatic server saves.

Syntax
save-on
Description
Enables the server writing to the world files. This is the default behavior.
Success Conditions
Always succeeds.


say[編輯]

say
限制條件

僅限服務器管理員

第一次發布

Classic 0.0.16a_01

向多個玩家發送信息。

格式
say <message …>
描述
向所有在線玩家播送message。若使用了多人的target selector (例如, @a),名單格式為"名字1,名字2,和名字3",兩個名字時為"名字1和名字2"。因此,無論使用了何種目標選擇器,此命令僅會輸出一次。
成功條件
All target selectors (e.g., @p) in the message must evaluate.


scoreboard[編輯]

scoreboard
限制條件

僅限服務器管理員

第一次發布

1.5 (13w04a)

These commands manage scoreboard objectives, players, and teams.

Syntax
scoreboard <objectives|players|teams> …

See Scoreboard#Command reference for more information.


seed[編輯]

seed
限制條件

僅限服務器管理員

第一次發布

1.3.1 (12w21a)

Displays the world seed.

Syntax
seed
Description
Displays the seed. This command can always be used in single-player mode, regardless of whether cheats are enabled or not.
Success Conditions
Always succeeds (if user is a command block, player in singleplayer, or server op).


setblock[編輯]

setblock
限制條件

僅限服務器管理員

第一次發布

1.7.2 (13w37a)

Changes a block to another block.

Syntax
setblock <x> <y> <z> <TileName> [dataValue] [oldBlockHandling] [dataTag]
Arguments
x y z
Specifies the position of the block to be changed. May use tilde notation to specify a position relative to the command's execution.
TileName
Specifies the new block. Must be a block id (for example, minecraft:stone).
dataValue (optional)
Specifies additional data to further describe the new block. Must be between 0 and 15 (inclusive). If not specified, defaults to 0.
oldBlockHandling (optional)
Specifies how to handle the block change. Must be one of:
  • destroy — The old block drops both itself and its contents (as if destroyed by a player). Plays the appropriate block breaking noise.
  • keep — Only air blocks will be changed (non-air blocks will be "kept").
  • replace — The old block drops neither itself nor any contents. Plays no sound.
If not specified, defaults to replace.
dataTag (optional)
Specifies the data tag for the new block. Must be a compound NBT tag (for example, {CustomName:Fred}).
Result
Fails if arguments are not specified properly, if tried to change a non-air block in keep mode, or tried to replace a block with an identical copy in keep or replace mode.
On success, changes the block at the specified position.
See also
  • /blockdata — modifies the data tags of a block
  • /clone — copies blocks from one region to another
  • /fill — fills a region with a block


setidletimeout[編輯]

setidletimeout
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Classic 0.0.15a_03

Sets the time before idle players are kicked from the server.

Syntax
setidletimeout <Minutes until kick>
Description
Set the idle kick timer. Any players idle for Minutes until kick will be kicked.
Success Conditions
Always succeeds.


setworldspawn[編輯]

setworldspawn
限制條件

僅限服務器管理員

第一次發布

1.7.2 (13w43a)

Sets the world spawn.

Syntax
setworldspawn
setworldspawn <x> <y> <z>
Arguments
x y z (optional)
Specifies the coordinates of the world spawn. x and z must be within the range -30,000,000 to 30,000,000 (inclusive). y must be between 0 and 256 (inclusive). May use tilde notation to specify coordinates relative to the command's execution. If not specified, defaults to the position of the command's execution. Not optional in command blocks.
If the server is not in adventure mode, players will always spawn on the topmost block near (x,z) — y is effectively ignored. If the server is in adventure mode, then the new spawnpoint will be the coordinates given exactly, including the y coordinate (even if undergound and even if there is no block there) -- if the y level given does not have space for the player then it will move up on the y axis until it does, at most y level 256.
Although spawn chunks are usually kept loaded at all times, new spawn chunks won't be loaded by this command until a player moves within range. Compasses (which in Minecraft point to the world spawn rather than north) will also not update to the change until the world is reloaded.
Result
Fails if arguments are not specified correctly.
On success, sets the world spawn to the specified coordinate.


spawnpoint[編輯]

spawnpoint
限制條件

僅限服務器管理員

第一次發布

1.4.2 (12w32a)

Sets the spawn point for a player.

Syntax
spawnpoint
spawnpoint <player>
spawnpoint <player> <x> <y> <z>
Arguments
player (optional)
Specifies the player whose spawn point should be set. Must be a player name or a target selector. If not specified, defaults to the command's user. Not optional in command blocks.
x y z (optional)
Specifies the coordinates of the player's new spawn point. x and z must be integers within the range -30,000,000 to 30,000,000 (inclusive). y must be an integer between 0 and 256 (inclusive). May use tilde notation to specify coordinates relative to the command's execution. If not specified, defaults to the position of the specified player(s).
Result
Fails if arguments are not specified correctly, or if player fails to resolve to one or more online players.
On success, sets the spawn point of the targeted player(s) to the specified coordinate.


spreadplayers[編輯]

spreadplayers
限制條件

僅限服務器管理員

第一次發布

1.6.1 (13w23a)

Teleports entities (players, mobs, items, etc.) to random surface locations within an area.

Syntax
spreadplayers <x> <z> <spreadDistance> <maxRange> <respectTeams> <player …>
Arguments
x z
Specifies the center of the region to spread targets to. x and z must be between -30,000,000 and 30,000,000 (exclusive). May use tilde notation to specify coordinates relative to the command's execution.
spreadDistance
Specifies the minimum distance between targets. Must be at least 0.0.
maxRange
Specifies the maximum distance on each horizontal axis from the center of the area to spread targets (thus, the area is square, not circular). Must be at least 1.0 greater than spreadDistance.
respectTeams
Specifies whether to keep teams together. Must be true or false. If true, targets on the same team will be teleported to the same location.
player
Specifies the targets to spread. Must be one or more player names and/or target selectors separated by spaces (@e is permitted to target entities other than players).
Result
Fails if arguments are not specified properly, if there are too many targets to satisfy the spreadDistance requirement within the specified area, or if a target is attempted to be spread to outside the world boundary.
On success, teleports targets to random surface locations within the specified area. Targets will always be placed on the top block at a location, and never on lava.
Examples
To teleport all players by team to random surface locations in a 1,000×1,000-block area centered on (0,0), with a minimum distance between teams of 200 blocks:
spreadplayers 0 0 200 500 true @a
To teleport one random player from each of three teams (Red, Blue, and Green), as well as Alice and Bob, to random surface locations in a 200×200-block area centered on (0,0), with a minimum distance between players of 50 blocks:
spreadplayers 0 0 50 100 false @r[team=Red] @r[team=Blue] @r[team=Green] Alice Bob
See also
/tp — teleports a single player or entity to a specific position (even underground).


stats[編輯]

stats
限制條件

僅限服務器管理員

第一次發布

1.8 (14w28a)

Manages the updating of scoreboard objectives with the results of other commands.

Commands can be executed by blocks (specifically, command blocks and signs) or by entities (players can execute commands directly, and other entities can be the origin of commands indirectly with the /execute command). When a command is executed, the command returns one or more "command stats": the success count, number of blocks affected, number of entities affected, number of items affected, and/or a query result (such as from /time query daytime).

The stats command allows "selectors" and "objectives" to be set (or cleared) for each of these command stats for specific blocks or entities. Selectors (for example, @e) are stored exactly as entered, and don't get evaluated immediately. When a command is later run by the block or entity, the stored selector is then used to target (other) entities and update their scoreboard objective with the value of the command stat. That value can then be displayed or operated on, just like any other scoreboard value.

The success count from a command block can also be acquired with a redstone comparator, but that is capped at a maximum value of 15, while scoreboard objectives can hold any value from -2,147,483,648 to 2,147,483,647. Success counts and query results are also usually displayed in the chat.

另見:Tutorials/Command stats
Syntax
stats block <x> <y> <z> clear <stat>
stats block <x> <y> <z> set <stat> <selector> <objective>
stats entity <selector2> clear <stat>
stats entity <selector2> set <stat> <selector> <objective>
Arguments
x y z (block mode only)
Specifies the position of the block to post command stats from. x and z must be between -30,000,000 and 30,000,000 (inclusive, without the commas) and y must be between 0 and 256 (inclusive). May use tilde notation to specify a position relative to the command's execution.
selector2 (entity mode only)
Specifies the entity to post command stats from. Must be a player name or a target selector.
stat
Specifies the command stat whose selector and objective are to be cleared or set. Must be one of:
  • AffectedBlocks — returns the number of blocks affected by a command
  • AffectedEntities — returns the number of entities affected by a command
  • AffectedItems — returns the number of items affected by a command
  • QueryResult — returns the result of a command query
  • SuccessCount — returns a command's success count
selector (set mode only)
Specifies the selector to be evaluated when a command is run by the specified block or entity to determine which entity(ies) scoreboard objective is to be updated with the result returned by stat. May be anything because it won't be evaluated until a command is run by the specified block or entity, but only a player name or a target selector will produce useful results (though player names can be fake, so even real players don't need to be online).
objective (set mode only)
Specifies the name of the objective to be updated with the result returned by stat. May be anything because it won't be evaluated until a command is run by the specified block or entity, but only the name of a defined objective will produce useful results.
Result
Fails if arguments are not specified properly, if the specified block cannot track stats (in other words, it fails if the specified block is not a command block or sign), or if selector2 fails to evaluate to one or more valid entities (named players must be online).
On success, clears or sets the selector and objective to be updated with the result returned by stat.
Examples
To set the block at (0,64,0) to update scoreboard objective MyObj of the nearest player with the value of any query result returned by the block:
stats block 0 64 0 set QueryResult @p MyObj
To stop the block at (0,64,0) from updating any scoreboard obectives with the success count of commands it executes:
stats block 0 64 0 clear SuccessCount
To have the nearest wither skull update the scoreboard objective NumBlocks of fake player #FakePlayer with the number of blocks affected by commands executed by the wither skull:
stats entity @e[type=WitherSkull,c=1] set AffectedBlocks #FakePlayer NumBlocks
See also
/blockdata — can also change the selector and objectives of blocks by altering data tags directly
/entitydata — can also change the selector and objectives of entities by altering data tags directly


stop[編輯]

stop
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Alpha 1.0.16

Stops a server.

Syntax
stop
Description
Saves all changes to disk, then shuts down the server.
Success Conditions
Always succeeds.


summon[編輯]

summon
限制條件

僅限服務器管理員

第一次發布

1.7.2 (13w36a)

召喚一個 實體 (生物, projectiles, 物品, vehicles, etc.).

Syntax
summon <EntityName> [x] [y] [z] [dataTag]
Arguments
EntityName
Specifies the entity to be summoned. Must be an entity id (for example, Bat, EntityHorse, WitherSkull, XPOrb, PrimedTNT, etc.) or LightningBolt.
x y z (optional)
Specifies the position to summon the entity. x and z must be between -30,000,000 to 30,000,000 (inclusive), and y must be at least 0. May use tilde notation to specify a position relative to the command's execution. If not specified, defaults to the position of the command's execution.
dataTag (optional)
Specifies the data tag for the entity. Must be a compound NBT tag (for example, {CustomName:Fred}). Lightning has no additional data tags that can be specified.
Result
Fails if arguments are not specified properly.
On success, creates the specified entity at the specified position.
例子:
召喚一個叫 "Powered Creeper" 的閃電苦力怕在當前的位置:
summon Creeper ~ ~ ~ {powered:1,CustomName:Powered Creeper}
在當前位置往西面10格召喚出一個閃電:
summon LightningBolt ~-10 ~ ~
在當前位置召喚一個帶有骷髏頭和岩漿桶的盔甲座
/summon ArmorStand ~ ~ ~ {Equipment:[{id:lava_bucket},{},{},{},{id:skull}]}


tell[編輯]

tell
限制條件

第一次發布

Alpha 1.0.16_02

Sends a private message to one or more players.

Syntax
tell <player> <private message …>
msg <player> <private message …>
w <player> <private message …>
Arguments
player
Specifies the targeted player(s) to send the private message to. Must be a player name (or a target selector, but only if the user is an operator).
private message
Specifies the message to send. May include spaces (as well as target selectors, but only if run from the server console — in other words, from the computer running the server, or by remote access to it).
Result
Fails if any target selectors in either argument fail to resolve to at least one online player, or if a named player is not online.
On success, only the targeted player(s) see the private message in their chat.
Any target selectors in the private message will each resolve to one or more player names (as "name" for a single player, "name1 and name2" for two players, or "name1, name2, …, and nameN" for N players, without the quotes).
Examples
To privately tell Alice to start the mission: tell Alice Start the mission!


tellraw[編輯]

tellraw
限制條件

僅限服務器管理員

第一次發布

1.7.2 (13w37a)

Sends a JSON message to players.

Syntax
tellraw <player> <raw json message>
Arguments
player
Specifies the player(s) to send the message to. Must be a player name or target selector.
raw json message
Specifies the message to send. Must be valid raw JSON text (for example, {text:"Hi there!",bold:true}).
Result
Fails if arguments are not specified properly, or if player fails to evaluate to one or more online players.
On success, the targeted players receive the JSON message in their chat.
See also
/say — send a simple text message to all players
/tell — send a simple text message to specific players


testfor[編輯]

testfor
限制條件

僅限服務器管理員

第一次發布

1.5 (13w03a)

Counts entities (players, mobs, items, etc.) matching specified conditions.

Syntax
testfor <player> [dataTag]
Arguments
player
Specifies the targets to count. Must be a player name or a target selector (@e is permitted to target entities other than players).
dataTag (optional)
Specifies the data tags the entities must have to match successfully. Must be a compound NBT tag (for example, {XpLevel:3}).
Result
Fails if arguments are not specified properly, or if player fails to resolve to one or more entities (named players must be online).
On success, produces a success count equal to the number of targets matching player, which can be measured by a redstone comparator facing away from the command block.
Examples
To test if Alice is online: testfor Alice
To count the number of players in survival mode within a 3-block radius of (0,64,0): testfor @a[0,64,0,3,m=0]
To count the number of players currently flying: testfor @a {abilities:{flying:1b}}
To count the number of zombies within a 20-block radius of (0,64,0): testfor @e[0,64,0,20,type=Zombie]


testforblock[編輯]

testforblock
限制條件

僅限服務器管理員

第一次發布

1.7.2 (13w37a)

Tests whether a certain block is in a specific location.

Syntax
testforblock <x> <y> <z> <TileName> [dataValue] [dataTag]
Arguments
x y z
Specifies the position of the block to test. x and z must be between -30,000,000 and 30,000,000 (inclusive, without the commas) and y must be between 0 and 255 (inclusive). May use tilde notation to specify a position relative to the command's execution.
TileName
Specifies the block to test for. Must be a valid block id (for example, minecraft:stone).
dataValue (optional)
Specifies the block data to test for. dataValue must be between -1 and 15 (inclusive). If not specified, or if -1, dataValue matches any block data value.
dataTag (optional)
Specifies the block data tags to test for. Must be a compound NBT tag (for example, {CustomName:Fred}). If not specified, dataTag matches any block data tag.
Result
Fails if arguments are not specified properly, if the block at the specified position does not match the specified block id or data, or if the specified data tag has different values than are defined in the block's data tag (dataTag does not need to match the block's entire data tag, and data tags in the argument which are undefined in the block will not cause the command to fail).
On success, returns a success count of 1.
Examples
To test if the block at (0,64,0) is any type of wool:
testforblock 0 64 0 minecraft:wool
testforblock 0 64 0 minecraft:wool -1
To test if the block at (0,64,0) is orange wool:
testforblock 0 64 0 minecraft:wool 1
To test if the block below is a jukebox with the "mall" record inside:
testforblock ~ ~-1 ~ minecraft:jukebox -1 {Record:2261}


testforblocks[編輯]

testforblocks
限制條件

僅限服務器管理員

第一次發布

1.8 (14w07a)

Tests whether the blocks in two regions match.

Syntax
testforblocks <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [mode]
Arguments
x1 y1 z1 and x2 y2 z2
Specifies two opposing corners of the region to use as the pattern to test for (the "source region"). x1, z1, x2, and z2 must all be between -30,000,000 and 30,000,000 (inclusive, without the commas), and y1 and y2 must be between 0 and 255 (inclusive). May use tilde notation to specify coordinates relative to the command's position. The number of blocks in the source region must not exceed 524,288.
x y z
Specifies the lower northwestern corner (the corner with the most-negative values) of the region to be checked (the "destination region"). x and z must both be between -30,000,000 and 30,000,000 (inclusive, without the commas), and y must be between 0 and 254 (inclusive). May use tilde notation to specify coordinates relative to the command's position. Source and destination regions may overlap.
mode (optional)
Specifies how to match blocks. Must be one of:
  • all — every block in the source and destination regions must match exactly.
  • maskedair blocks in the source region will match any block in the destination region.
If not specified, defaults to all.
Result
Fails if arguments are not specified properly, or if the source and destination regions do not match.
On success, returns the number of matching blocks (the total number of blocks in all mode, or the number of source region non-air blocks in masked mode).


time[編輯]

time
限制條件

僅限服務器管理員

第一次發布

1.3.1 (12w16a)

Changes or queries the world's game time.

Syntax
time <add|query|set> <value>
Arguments
value
Specifies the time to add, query, or set:
  • add - Must be between 0 and 2,147,483,647 (inclusive, without the commas)
  • query - Must be daytime or gametime.
  • set - Must be between 0 and 2,147,483,647 (inclusive, without the commas), day, or night.
Result
Fails if arguments are not specified properly.
On success:
  • add - adds value to the world's game time
  • query - returns the day time (game ticks since midnight) or the game time (game ticks since world start)
  • set - sets the world game time to value (day = 1,000, night = 13,000).
Examples
To set the time to 1,000: time set 1000 or time set day
To add one day to the world time: time add 24000


title[編輯]

title
限制條件

僅限服務器管理員

第一次發布

1.8 (14w20a)

Manages screen titles.

Screen titles are displayed to players as a single line of large center-aligned text in the middle of their displays and can include a second line of text called a "subtitle". Both lines can include complicated formatting. Screen titles can be set to fade in and fade out, and the duration they are displayed can also be specified. Screen titles scale in size with the GUI Scale and screen titles which are too big to fit on the screen are not line-wrapped (they just overflow off the screen on both sides).

Syntax
The command has five variations, each with different arguments.
title <player> clear (removes a screen title from the screen)
title <player> reset (resets options to default values)
title <player> subtitle <raw json title> (specifies the subtitle text)
title <player> times <fadeIn> <stay> <fadeOut> (specifies fade-in, stay, and fade-out times)
title <player> title <raw json title> (displays the screen title)
Arguments
player
Specifies the player(s) to display a screen title to. Must be a player name or target selector.
raw json title (subtitle and title mode only)
Specifies the text to display as a title or subtitle. Must be valid raw JSON text (for example, {text:"Chapter I",bold:true}).
fadeIn, stay, and fadeOut (times mode only)
Specifies the time in game ticks (1/20ths of a second) for the screen title to fade in, stay, and fade out. All values must be between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas), but values below 0 will be treated as 0. If not specified (or if reset), default to 20 (1 second), 60 (3 seconds), and 20 (1 second).
Result
File:Title command.png
Example result of the title command.
Fails if arguments are not specified properly, or if player fails to evaluate to one or more online players.
On success:
  • clear — Clears the screen title from the screens of the specified player(s). If no screen title is currently being displayed, has no effect.
  • reset — Resets the subtitle text to blank text, the fade-in time to 20 (1 second fade-in), the stay time to 60 (3 seconds), and the fade-out time to 20 (1 second fade-out) for the specified player(s).
  • subtitle — If a screen title is currently being displayed to the specified player(s), changes the currently-displayed subtitle to the new specified text; otherwise, specifies the subtitle for the next screen title to be displayed to the specified player(s).
  • times — If a screen title is currently being displayed to the specified player(s), changes the fade-in, stay, and fade-out times of the current screen title (and of all future screen titles); otherwise, specifies the times for future screen titles to be displayed to the specified player(s).
  • title — Displays the specified text to the specified player(s), or changes the currently-displayed text to the new specified text. After fade-out, resets the subtitle back to blank text, but does not reset fade-in, stay, and fade-out times.
Examples
To display a bold screen title "Chapter I" with a gray italic subtitle "The story begins…" to all players:
  1. title @a subtitle {text:"The story begins…",color:gray,italic:true}
  2. title @a title {text:"Chapter I",bold:true}


toggledownfall[編輯]

toggledownfall
限制條件

僅限服務器管理員

第一次發布

1.3.1 (12w16a)

Toggles the weather.

Syntax
toggledownfall
Result
Always succeeds. If weather is currently clear, rain or snow will start. If weather is currently rain or snow, it will stop.


tp[編輯]

tp
限制條件

僅限服務器管理員

第一次發布

Alpha 1.0.16_01

Teleports entities (players, mobs, items, etc.).

Syntax
tp [target player] <destination player>
tp [target player] <x> <y> <z> [<y-rot> <x-rot>]
Arguments
target player (optional)
Specifies the targets to be teleported. Must be either a player name or a target selector (@e is permitted to target entities other than players). If not specified, defaults to the command's user. Not optional in command blocks.
destination player
Specifies the targets to teleport the target player to. Must be either a player name or a target selector (@e is permitted to target entities other than players).
x y z
Specifies the coordinates to teleport the targets to. x and z must fall within the range -30,000,000 to 30,000,000 (exclusive, without the commas), and y must be at least 0. May use tilde notation to specify a position relative to the target's current position.
y-rot (optional)
Specifies the horizontal rotation (-180.0 for due north, -90.0 for due east, 0.0 for due south, 90.0 for due west, to 179.9 for just west of north, before wrapping back around to -180.0). Tilde notation can be used to specify a rotation relative to the target's previous rotation.
x-rot (optional)
Specifies the vertical rotation (-90.0 for straight up to 90.0 for straight down). Tilde notation can be used to specify a rotation relative to the target's previous rotation.
Result
Fails if the arguments are not specified correctly, if target player fails to resolve to one or more entities (named players must be online), or if destination player fail to resolve to a single entity (a named player must be online).
On success, teleports the targets to the specified destination.
Examples
To teleport yourself to Alice: tp Alice
To teleport all players to yourself: tp @a @p
To teleport yourself to (x,z) = (100,100) but three blocks above your current position: tp 100 ~3 100
To rotate the nearest player 10 degrees to the right without changing their position: tp @p ~ ~ ~ ~10 ~


trigger[編輯]

trigger
限制條件

第一次發布

1.8 (14w06a)

Sets a trigger to be activated.

Syntax
trigger <objective> <add|set> <value>
Description
Used together with /tellraw to let players activate systems made by operators or mapmakers. The objective must be an enabled scoreboard objective of the criteria "trigger". The given value is either added to its existing value, or becomes its new value, depending on whether the second argument is add or set. The value of the objective is only changed for the player who uses the command.
Success Conditions
objective must have the "trigger" criteria and the player who is running the command must be able to modify objective.


weather[編輯]

weather
限制條件

僅限服務器管理員

第一次發布

1.4.2 (12w32a)

Sets the weather.

Syntax
weather <clear|rain|thunder> [duration in seconds]
Arguments
clear
Specifies to set the weather to clear weather.
rain
Specifies to set the weather to rain (or snow in cold biomes).
thunder
Specifies to set the weather to a thunderstorm (or a thunder snowstorm in cold biomes).
duration in seconds
Specifies the time for the specified weather to last. Must be between 1 and 1,000,000 (inclusive, without the commas).
Result
Fails if arguments are not specified properly.
On success, changes the weather for the specified duration (in seconds).
Examples
To get clear weather for one Minecraft day: weather clear 1200
To make it rain, but let it end at its own pace: weather rain 1


whitelist[編輯]

whitelist
限制條件

僅限多人遊戲
僅限服務器管理員
不能在指令方塊上使用

第一次發布

Beta 1.3

Manages the server whitelist.

Server ops will always be able to connect when the whitelist is active, even if their names do not appear in the whitelist.

Syntax
The command has six variations.
whitelist add <player>
whitelist list
whitelist off
whitelist on
whitelist reload
whitelist remove <player>
Arguments
player (add and remove mode only)
Specifies the player(s) to add or remove from the whitelist.
Result
Fails if player doesn't exist
On success:
  • add — Adds the player name to the whitelist. The player does not need to be online.
  • list — Displays all player names in the whitelist.
  • off — Disables the server's use of a whitelist.
  • on — Enables the server's use of a whitelist.
  • reload — Reloads the list of player names in white-list.txt (1.7.5 or earlier) or whitelist.json (1.7.6 or later) from disk (used when white-list.txt or whitelist.json has been modified outside of Minecraft).
  • remove — Removes the player name from the whitelist. The player does not need to be online.


worldborder[編輯]

worldborder
限制條件

僅限服務器管理員

第一次發布

1.8 (14w17a)

These commands manage the world border.

Syntax
The command has eight variations, each with different arguments:
worldborder add <sizeInBlocks> [timeInSeconds] (increases the world border diameter)
worldborder center <x> <z> (recenters the world boundary)
worldborder damage amount <damagePerBlock> (specifies world border damage rate)
worldborder damage buffer <sizeInBlocks> (specifies world border damage buffer distance)
worldborder get (returns the world border diameter)
worldborder set <sizeInBlocks> [timeInSeconds] (sets the world border size and speed)
worldborder warning distance <blocks> (specifies the world border warning distance)
worldborder warning time <seconds> (specifies the world border warning time)
Arguments
sizeInBlocks (add, damage buffer, and set modes only)
Specifies a distance in blocks:
  • add — specifies the number of blocks to add to the world border diameter.
  • damage buffer — specifies the distance outside the world buffer before players start taking damage. Must be at least 0.0. Initially set to 5.0.
  • set — Specifies the new diameter for the world border. Must be between 1.0 and 60,000,000 (inclusive, without the commas).
timeInSeconds (add and set modes only)
Specifies the number of seconds it should take for the world border to move from its current diameter to the new diameter. Must be at least 0. If not specified, defaults to 0.
x z (center mode only)
Specifies the horizontal coordinates of the world border's center. Must be between -30,000,000 and 30,000,000 (inclusive, without the commas). May use tilde notation to specify coordinates relative to the command's execution.
damagePerBlock (damage amount mode only)
Specifies the damage a player takes per second per block past the world border buffer. For example, if damagePerBlock is 0.1, a player 5 blocks outside the world border buffer will take 0.5 damage per second (damage less than half a heart might not change the visual health display, but will still accumulate). Must be at least 0.0. Initially set to 0.2.
blocks (warning distance mode only)
Specifies the distance from the world border at which players will begin to see a visual warning of the world border's proximity. Must be at least 0. Initially set to 5.
seconds (warning time mode only)
Specifies the time in seconds before a moving world border overruns a player when they will begin to see a visual warning of the world border's proximity. For example, if seconds is 5, players will get a visual warning when the moving world border is 5 seconds or less away from passing their position. Must be at least 0. Initially set to 15.
Result
Fails if arguments are not specified properly, or if new world diameter will be less than 1.0 or greater than 60,000,000.
On success:
  • add — The world border begins changing its diameter. If sizeInBlocks is positive, the world border will turn green and start increasing; if negative, the world border will turn red and start decreasing. If timeInSeconds is 0 or unspecified, the change occurs immediately; otherwise the change proceeds at a rate of (sizeInBlocks/2)/timeInSeconds blocks per second.
  • center — The center of the world border immediate moves to the specified coordinates.
  • damage amount — Sets the world border damage amount to the specified value. Any player outside the world border buffer will take this amount of damage per second per block past the world border buffer distance.
  • damage buffer — Sets the world border buffer distance to the specified value. Players won't take damage until they move past this distance from the world border.
  • get — Shows the current world border diameter in the chat.
  • set — The world border begins changing its diameter. If sizeInBlocks is bigger than the current diameter, the world border will turn green and start increasing; if smaller, the world border will turn red and start decreasing. If timeInSeconds is 0 or unspecified, the change occurs immediately; otherwise the change proceeds at a rate of ((sizeInBlocks-<cirrent diameter>)/2)/timeInSeconds blocks per second.
  • warning distance — Sets the world border warning distance to this value.
  • warning time — Sets the world border warning time to this value.


xp[編輯]

xp
限制條件

僅限服務器管理員

第一次發布

1.3.1 (12w16a)

Adds experience to a player.

Syntax
xp <amount> [player]
xp <amount>L [player]
Arguments
amount
Specifies the amount of experience to give to the player. Must be between 0 and 2,147,483,647 (inclusive, without the commas).
If an L is added to the end, adds levels instead. Levels must be between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas) — negative values remove levels instead of adding them.
player (optional)
Specifies the target of the command. Must be a player name or a target selector. If not specified, defaults to the command's executor. Not optional in command blocks.
Result
Fails if arguments are not specified properly, or if player fails to resolve to one or more online players.
On success, adds experience or adds/removes levels. Total experience and levels will not be reduced below 0.
Examples
To give 7 experience to yourself: xp 7
To give 3 levels to Alice: xp 3L Alice
To remove all levels from all players: xp -2147483648L @a


歷史[編輯]

正式版本
1.3.1 12w16a 增加作弊模式
12w24a 增加/publish命令
12w25a 局域網連接可以選擇是否允許作弊
12w27a 增加/debug命令
1.4.2 12w32a 增加/difficuty/gamerule/spawnpoint/weather命令
12w37a 增加/clear命令
12w38a /clear命令可以指定移除特定的方塊或物品
12w41a /xp的經驗上限提高到2,147,483,647
1.4.4 1.4.4pre 增加/enchant命令
1.5 13w03a 增加指令方塊獨佔的/testfor命令。
13w04a 增加計分板/scoreboard系列命令。
1.7.2 13w36a 增加/summon指令。
13w37a 增加/setblock/testforblock/tellraw指令。
13w43a 增加/setworldspawn指令。
1.8 14w02a 增加/blockdata指令。
14w03a 增加/fill/clone指令。
14w04a 增加/particle指令。
14w06a 增加/trigger指令。
14w07a 增加/execute/testforblocks指令。
14w19a 增加/worldborder指令。
14w20a 增加/title指令。
14w26a 增加/replaceitem指令。

引用[編輯]


另見[編輯]