Minecraft Wiki
0tkumbot (トーク | 投稿記録)
(更新済み要素の項目から{{upcoming}}を除去)
編集の要約なし
1行目: 1行目:
 
{{要翻訳}}
 
{{要翻訳}}
 
{{要更新}}
 
{{要更新}}
 
 
{{TOC|right}}
 
{{TOC|right}}
  +
{{exclusive|java|pocket|education}}
 
{{About|コンソールコマンド|コマンドを実行するブロック|コマンドブロック|コマンドを実行するトロッコ|コマンドブロック付きトロッコ}}
 
{{About|コンソールコマンド|コマンドを実行するブロック|コマンドブロック|コマンドを実行するトロッコ|コマンドブロック付きトロッコ}}
   
'''コマンド(Command)'''は、PC版と[[Pocket Edition]]に存在する、定められた構文に従って書かれた高度な機能を持つテキストである。
+
'''コマンド''' ('''Command''') は、[[Java Edition]] および [[Pocket Edition]] に存在する、定められた構文に従って書かれた高度な機能を持つテキストである。
{{TOC|right}}
 
   
 
== 使用方法 ==
 
== 使用方法 ==
   
通常の ''Minecraft'' の[[スタンドアローンクライアント|クライアント]]では、{{key|T}}キーを押すか直接{{key|/}}キーを入力して[[チャット]]画面を開いて入力する。{{key|/}}キーを使ってチャット画面を開いた場合は、コマンドの先頭のスラッシュが最初から入力された状態でチャット画面が開く。コマンドを入力中に{{key|Tab}}キーを押すと、使用可能なコマンドや引数、見ているブロックの座標が表示され、そのまま使用できる。
+
通常の ''Minecraft'' の[[スタンドアローンクライアント|クライアント]]では、{{key|T}} キーを押すか直接 {{key|/}} キーを入力して[[チャット]]画面を開いて入力する。{{key|/}} キーを使ってチャット画面を開いた場合は、コマンドの先頭のスラッシュが最初から入力された状態でチャット画面が開く。{{key|Up}} と {{key|Down}} キーを使用して、以前に実行したコマンドを入力できる。コマンドを入力中に {{key|Tab}} キーを押すと、使用可能なコマンドや引数、見ているブロックの座標が表示され、そのまま使用できる。
   
コマンドは[[サーバー]]のコンソールで使用することもできるその場合はコマンドにはスラッシュ記号は不要である。
+
コマンドは[[サーバー]]のコンソールで使用することもできるが、その場合はコマンドには {{key|/}} '''不要'''である。この方法でサーバー管理者がコマンドを実行することを「Ghosting」と呼ぶ
   
[[コマンドブロック]]から実行されるコマンドにスラッシュ記号をつけてもよいが、必須ではない。また、コマンドブロック内のコマンドは追加でオプションの変数を記述する必要がある場合がある。その変数には、一般的にはプレイヤー名などが当てはまる。
+
[[コマンドブロック]]から実行されるコマンドにスラッシュ記号をつけても'''よい'''が、必須ではない。また、コマンドブロック内のコマンドは追加でオプションの変数を記述する必要がある場合がある。その変数には、一般的にはプレイヤー名などが当てはまる。
   
大多数のコマンドは、以下の状況でのみ有効である:
+
大多数のコマンドは、以下の状況でのみ有効である
 
* [[マルチプレイ]][[サーバー]]にて、管理者または[[コマンドブロック]]によって実行された場合
 
* [[マルチプレイ]][[サーバー]]にて、管理者または[[コマンドブロック]]によって実行された場合
* その他のマルチプレイでは、「LANに開く」からチートを有効にしてローカルマルチプレイを開始した場合、または自分で[[サーバー]]をホスティングしている場合
+
* その他のマルチプレイでは、「LAN に開く」からチートを有効にしてローカルマルチプレイを開始した場合、または自分で[[サーバー]]をホスティングしている場合
 
* [[シングルプレイ]]で、ワールド生成時にチートを有効にした場合(「その他のワールドオプション」ボタンから設定する)
 
* [[シングルプレイ]]で、ワールド生成時にチートを有効にした場合(「その他のワールドオプション」ボタンから設定する)
   
 
いくつかのコマンドは、シングルプレイにおいてチートが有効でなくとも実行できる。
 
いくつかのコマンドは、シングルプレイにおいてチートが有効でなくとも実行できる。
   
'''注意:''' シングルプレイでワールドを作成時にチートを有効にしなかった場合でも、ローカルマルチプレイを開始する際にチートを有効にするとコマンドが使えるようになる({{key|Esc}} → 「LANに開く」 → 「チートを許可する:オン」)。この際他のプレイヤーがゲームに参加する必要はない。ワールドを出るとコマンドは使えなくなるが、コマンドを使ってワールドに加えた変更はそのまま保持される。ワールドに入る度に同じ手順を繰り返せばよい。ローカルマルチプレイを開始するとゲームを一時停止できなくなるので注意。ワールドから出ればローカルマルチプレイは終了される。
+
'''注意'''シングルプレイでワールドを作成時にチートを有効にしなかった場合でも、ローカルマルチプレイを開始する際にチートを有効にするとコマンドが使えるようになる({{key|Esc}} → 「LAN に開く」 → 「チートを許可するオン」)。この際他のプレイヤーがゲームに参加する必要はない。ワールドを出るとコマンドは使えなくなるが、コマンドを使ってワールドに加えた変更はそのまま保持される。ワールドに入る度に同じ手順を繰り返せばよい。ローカルマルチプレイを開始するとゲームを一時停止できなくなるので注意。ワールドから出ればローカルマルチプレイは終了される。
   
 
=== チルダ表記法 ===
 
=== チルダ表記法 ===
   
多数のコマンドでは[[wikipedia:ja:チルダ|チルダ]]の <code>~</code> 記号で「相対座標」を使うことができる。チルダ記号と一緒に書かれた数字は、コマンドで指定した座標からの「オフセット」であり、+-の符号で正負の方向を指定する。<code>~</code> 一文字で <code>~0</code> を表す。
+
多数のコマンドでは[[wikipedia:ja:チルダ|チルダ]]の <code>~</code> 記号で「相対座標」を使うことができる。チルダ記号と一緒に書かれた数字は、コマンドで指定した座標からの「オフセット」であり、+- の符号で正負の方向を指定する。<code>~</code> 一文字で <code>~0</code> を表す。
   
例えば、 <code>tp 0 64 0</code> というコマンドではプレイヤーをx:0、y:64、z:0の位置へテレポートするが、<code>tp ~3 ~ ~-3</code> というコマンドではプレイヤーをX方向へ「+3」(つまり東へ3ブロック分)、高さはそのまま、そしてZ方向へ「-3」(つまり北へ3ブロック分)テレポートさせる。
+
例えば、 <code>tp 0 64 0</code> というコマンドではプレイヤーを x:0、y:64、z:0 の位置へテレポートするが、<code>tp ~3 ~ ~-3</code> というコマンドではプレイヤーをX方向へ「+3」(つまり東へ3ブロック分)、高さはそのまま、そしてZ方向へ「-3」(つまり北へ3ブロック分)テレポートさせる。
   
絶対座標は相対座標と一緒に使うことが出来る。例えば、<code>tp ~ 64 ~</code> はX座標とZ座標はそのままに、Y座標:64へテレポートさせるコマンドである。
+
絶対座標は相対座標と一緒に使うことが出来る。例えば、<code>tp ~ 64 ~</code> は X 座標と Z 座標はそのままに、Y 座標:64 へテレポートさせるコマンドである。
   
 
相対座標の原点はそれぞれのコマンドに依存する。例えば {{cmd|tp}} コマンドの原点はテレポート開始時の座標である。その他のコマンドでは、原点はコマンドが実行された座標、またはコマンドで特別に指定した座標である。
 
相対座標の原点はそれぞれのコマンドに依存する。例えば {{cmd|tp}} コマンドの原点はテレポート開始時の座標である。その他のコマンドでは、原点はコマンドが実行された座標、またはコマンドで特別に指定した座標である。
39行目: 38行目:
 
大多数のコマンドでは、プレイヤー名でプレイヤーを指定する代わりに、条件を満たす一人もしくはそれ以上のプレイヤーを指定できる。条件でプレイヤーを指定する場合は、「ターゲットセレクター」の種類を選び、必要に応じて、満たされるべき条件を引数として追加できる。
 
大多数のコマンドでは、プレイヤー名でプレイヤーを指定する代わりに、条件を満たす一人もしくはそれ以上のプレイヤーを指定できる。条件でプレイヤーを指定する場合は、「ターゲットセレクター」の種類を選び、必要に応じて、満たされるべき条件を引数として追加できる。
   
例えば以下のコマンドでは、「Red」チームに所属する全てのプレイヤーのゲームモードをクリエイティブモードに変更する。各プレイヤー名を個別に指定するより効率的である
+
例えば以下のコマンドでは、「Red」チームに所属する全てのプレイヤーのゲームモードをクリエイティブモードに変更する。各プレイヤー名を個別に指定するより効率的である: <code>/gamemode creative @a[team=Red]</code>
:<code>/gamemode creative @a[team=Red]</code>
 
   
  +
<!-- please retain double newline above for section differentiation -->
   
 
==== ターゲットセレクターの種類 ====
 
==== ターゲットセレクターの種類 ====
56行目: 55行目:
 
|-
 
|-
 
| <code>@e</code> || 全てのエンティティ
 
| <code>@e</code> || 全てのエンティティ
  +
|-
  +
| <code>@s</code> || コマンドを実行しているエンティティ
 
|}
 
|}
   
64行目: 65行目:
 
: 最も近い一人のプレイヤーが対象になる。 もしも複数のプレイヤーが正確に同じ距離に存在した場合は、サーバーに最近参加したプレイヤーが優先して選ばれる。
 
: 最も近い一人のプレイヤーが対象になる。 もしも複数のプレイヤーが正確に同じ距離に存在した場合は、サーバーに最近参加したプレイヤーが優先して選ばれる。
   
: [[#ターゲットセレクターの引数|ターゲットセレクターの引数]] 追記することで、対象となるプレイヤーをさらに絞り込める。例えば <code>@p[team=Red]</code> とすれば最も近い「Red」チームのプレイヤーを対象にする。さらに近くにプレイヤーが居たとしても、チームが違うならば対象にならない。
+
: [[#ターゲットセレクターの引数|ターゲットセレクターの引数]]を使って、対象となるプレイヤーをさらに絞り込める。例えば <code>@p[team=Red]</code> とすれば最も近い「Red」チームのプレイヤーを対象にする。さらに近くにプレイヤーが居たとしても、チームが違うならば対象にならない。
   
 
: 引数 <code>c</code> を使えば、対象になるプレイヤーの人数を増やすことが出来る(例えば <code>@p[c=3]</code> なら最寄りの3人のプレイヤーが対象になる)。<code>c</code> にマイナスの値を設定した場合は、対象を選ぶ優先順位が逆になる(例えば、<code>@p[c=-1]</code> だと最も''遠い''プレイヤーを対象にする)。
 
: 引数 <code>c</code> を使えば、対象になるプレイヤーの人数を増やすことが出来る(例えば <code>@p[c=3]</code> なら最寄りの3人のプレイヤーが対象になる)。<code>c</code> にマイナスの値を設定した場合は、対象を選ぶ優先順位が逆になる(例えば、<code>@p[c=-1]</code> だと最も''遠い''プレイヤーを対象にする)。
70行目: 71行目:
 
; <code>@r</code>
 
; <code>@r</code>
   
: ランダムなプレイヤーを対象にする(<code>type</code>引数を使えばランダムなエンティティも対象になる)。
+
: ランダムなプレイヤーを対象にする(<code>type</code> 引数を使えばランダムなエンティティも対象になる)。
   
: [[#ターゲットセレクターの引数|ターゲットセレクターの引数]] を使って、対象となるプレイヤーを絞り込むことが出来る。 例えば、<code>@r[team=Red]</code> は「Red」チームのプレイヤーの中からランダムで一人を対象にする。
+
: [[#ターゲットセレクターの引数|ターゲットセレクターの引数]]を使って、対象となるプレイヤーを絞り込むことが出来る。 例えば、<code>@r[team=Red]</code> は「Red」チームのプレイヤーの中からランダムで一人を対象にする。
   
 
: <code>c</code> 引数を使えば対象になるプレイヤーの人数を増やせる。例えば、<code>@r[c=3]</code> はランダムに3人のプレイヤーを対象にする。
 
: <code>c</code> 引数を使えば対象になるプレイヤーの人数を増やせる。例えば、<code>@r[c=3]</code> はランダムに3人のプレイヤーを対象にする。
   
: <code>type</code> 引数を''使わない''場合は、<code>@r</code> は常時プレイヤーを対象とする。 <code>type</code> 引数を使えばプレイヤー以外のエンティティを対象にできる(例えば、<code>@r[type=Zombie]</code> はランダムな[[ゾンビ]]を対象にする。<code>@r[type=!Player]</code> はプレイヤー以外のエンティティをランダムで対象にする。<code>@r[type=!Zombie]</code> はゾンビ以外からランダムで対象にする)。
+
: <code>type</code> 引数を''使わない''場合は、<code>@r</code> は常時プレイヤーを対象とする。 <code>type</code> 引数を使えばプレイヤー以外のエンティティを対象にできる(例えば、<code>@r[type=zombie]</code> はランダムな[[ゾンビ]]を対象にする。<code>@r[type=!player]</code> はプレイヤー以外のエンティティをランダムで対象にする。<code>@r[type=!zombie]</code> はゾンビ以外からランダムで対象にする)。
   
 
; <code>@a</code>
 
; <code>@a</code>
82行目: 83行目:
 
: 死んだプレイヤーも含めて、全てのプレイヤーを対象にする。これ以外に死んだプレイヤーを対象にするセレクターはない。
 
: 死んだプレイヤーも含めて、全てのプレイヤーを対象にする。これ以外に死んだプレイヤーを対象にするセレクターはない。
   
: [[#ターゲットセレクターの引数|ターゲットセレクターの引数]] を使って、対象にするプレイヤーを絞り込むことができる。例えば、<code>@a[team=Red]</code> は「Red」チーム内の全プレイヤーを対象にする。
+
: [[#ターゲットセレクターの引数|ターゲットセレクターの引数]]を使って、対象にするプレイヤーを絞り込むことができる。例えば、<code>@a[team=Red]</code> は「Red」チーム内の全プレイヤーを対象にする。
   
; <code>@e</code> '''1.8から'''
+
; <code>@e</code>
   
 
: 全てのエンティティを対象にする(プレイヤーも含める)。
 
: 全てのエンティティを対象にする(プレイヤーも含める)。
   
: [[#ターゲットセレクターの引数|ターゲットセレクターの引数]] を使って、対象にするエンティティを絞り込むことが出来る。 例えば、<code>@e[type=Cow]</code> は[[ウシ]]だけを対象にする。
+
: [[#ターゲットセレクターの引数|ターゲットセレクターの引数]]を使って、対象にするエンティティを絞り込むことが出来る。 例えば、<code>@e[type=cow]</code> は[[ウシ]]だけを対象にする。
  +
 
; <code>@s</code>
  +
  +
: 1つのエンティティのみを対象とする(死亡したプレイヤーを含む、コマンドを実行したエンティティ)。実行者がエンティティでない場合、例えば実行者がコマンドブロックまたはサーバーコンソールであった場合、このセレクターは何も機能しないん。
  +
  +
: [[#ターゲットセレクターの引数|ターゲットセレクターの引数]]を使って、対象となるプレイヤーをさらに絞り込める。例えば、<code>@s[type=cow,team=Red]</code> は実行者が「Red」チームのウシだった場合、コマンドの実行者を対象にする。
  +
  +
<!-- please retain double newline above for section differentiation -->
   
 
==== ターゲットセレクターの引数 ====
 
==== ターゲットセレクターの引数 ====
94行目: 103行目:
 
{| class="floatright wikitable" style="clear:none;margin-left:1em;"
 
{| class="floatright wikitable" style="clear:none;margin-left:1em;"
 
|+ ターゲットセレクターの引数の概要
 
|+ ターゲットセレクターの引数の概要
  +
! colspan="2" | ポジションによる選択
  +
|-
 
! 引数 !! 選択基準
 
! 引数 !! 選択基準
 
|-
 
|-
| <code>x</code>, <code>y</code>, <code>z</code> || 座標
+
| <code>x</code>, <code>y</code>, <code>z</code> || [[#座標で対象を絞り込む|座標]]
 
|-
 
|-
| <code>r</code>, <code>rm</code> || 半径(最大、最小)
+
| <code>r</code>, <code>rm</code> || [[#半径で対象を絞り込む|半径(最大、最小)]]
 
|-
 
|-
 
| <code>dx</code>, <code>dy</code>, <code>dz</code> || [[#範囲で絞り込む|範囲の大きさ]]
| <code>m</code> || ゲームモード
 
 
|-
 
|-
  +
! colspan="2" | スコアボード値による選択
| <code>c</code> || 数
 
 
|-
 
|-
  +
! 引数 !! 選択基準
| <code>l</code>, <code>lm</code> || 経験値レベル(最大、最小)
 
 
|-
 
|-
| <code>score_''name''</code> || 最大スコア
+
| <code>score_''name''</code> || [[#スコアの値で絞り込む|最大スコア]]
  +
|-
  +
| <code>score_''name''_min</code> || [[#スコアの値で絞り込む|最小スコア]]
  +
|-
  +
| <code>tag</code> || [[#タグで絞り込む|スコアボードのタグ]]
  +
|-
 
| <code>team</code> || [[#チームで絞り込む|チーム名]]
  +
|-
  +
! colspan="2" | 特徴による選択
  +
|-
  +
! 引数 !! 選択基準
 
|-
 
|-
| <code>score_''name''_min</code> || 最小スコア
+
| <code>c</code> || [[#数で絞り込む|数]]
 
|-
 
|-
 
| <code>l</code>, <code>lm</code> || [[#経験値レベルで絞り込む|経験値レベル(最大、最小)]]
| <code>team</code> || チーム名
 
 
|-
 
|-
| <code>name</code> || エンティティ名
+
| <code>m</code> || [[#ゲームモードで絞り込む|ゲームモード]]
 
|-
 
|-
  +
| <code>name</code> || [[#名前で絞り込む|エンティティ名]]
| <code>dx</code>, <code>dy</code>, <code>dz</code> || 範囲の大きさ
 
 
|-
 
|-
| <code>rx</code>, <code>rxm</code> || x軸を中心とした向き(最大、最小)
+
| <code>rx</code>, <code>rxm</code> || [[#縦向きの回転で絞り込む|X 軸を中心とした向き(最大、最小)]]
 
|-
 
|-
| <code>ry</code>, <code>rym</code> || y軸を中心とした向き (最大、最小)
+
| <code>ry</code>, <code>rym</code> || [[#水平方向の回転で絞り込む|Y 軸を中心とした向き (最大、最小)]]
 
|-
 
|-
| <code>type</code> || エンティティの種類
+
| <code>type</code> || [[#種類で絞り込む|エンティティの種類]]
 
|}
 
|}
   
ターゲットセレクターの後に引数を追記することで、選択基準をさらに編集することが出来る。 <code>@a</code> または <code>@e</code> セレクターと一緒に使えば、全ての中から特定の限られた対象に絞り込むことが出来る。<code>@p</code> または <code>@r</code> セレクターと一緒に使えば、最寄りのまたはランダムに選ばれた対象の中からさらに絞り込むことが出来る。
+
ターゲットセレクターの後に引数を追記することで、選択基準をさらに編集することが出来る。 <code>@a</code> または <code>@e</code> セレクターと一緒に使えば、全ての中から特定の限られた対象に絞り込むことが出来る。<code>@p</code> または <code>@r</code> セレクターと一緒に使えば、最寄りのまたはランダムに選ばれた対象の中からさらに絞り込むことが出来る。
   
引数はセレクターの後に四角括弧を追記し、その中にコンマで区切って値を書く。:
+
引数はセレクターの後に四角括弧を追記し、その中にコンマで区切って値を書く
   
 
: <code>@<セレクター>[<引数>=<''値''>,<引数>=<''値''>,…]</code>.
 
: <code>@<セレクター>[<引数>=<''値''>,<引数>=<''値''>,…]</code>.
131行目: 152行目:
 
括弧の中のスペースは無効であり、引数の値を区切るにはコンマだけが有効である。
 
括弧の中のスペースは無効であり、引数の値を区切るにはコンマだけが有効である。
   
引数では大文字と小文字は区別され、未知の引数を書いた場合は無視される。例えば、 <code>kill @e[type=Creeper,r=20]</code> は半径20ブロック以内の全てのクリーパーを抹消するが、 <code>kill @e['''T'''ype=Creeper,r=20]</code> ('type'内の'T'が大文字)と書くとクリーパーだけを指定するはずの'type'の書き方が間違っているため、半径20ブロック以内の全てのエンティティがキルされる。
+
引数では大文字と小文字は区別され、未知の引数を書いた場合は無視される。例えば、<code>kill @e[type=creeper,r=20]</code> は半径20ブロック以内の全てのクリーパーをキルするが、 <code>kill @e['''T'''ype=creeper,r=20]</code> ('type' 内の 'T' が大文字)と書くとクリーパーだけを指定するはずの 'type' の書き方が間違っているため、半径20ブロック以内の全てのエンティティがキルされる。
  +
 
<code>x</code>、<code>y</code>、<code>z</code>、<code>r</code> の4つの引数は、最初に書く場合は単純に数値だけを書いて指定できる。したがって、以下の2つのコマンドは同じ意味である
   
<code>x</code>、<code>y</code>、<code>z</code>、<code>r</code> の4つの引数は、最初に書く場合は単純に数値だけを書いて指定できる。したがって、以下の2つのコマンドは同じ意味である:
 
 
:<code>/gamemode creative @a[x=10,y=20,z=30,r=4]</code>
 
:<code>/gamemode creative @a[x=10,y=20,z=30,r=4]</code>
 
:<code>/gamemode creative @a[10,20,30,4]</code>
 
:<code>/gamemode creative @a[10,20,30,4]</code>
   
;座標で対象を絞り込む
+
; {{anchor|座標で対象を絞り込む}}座標で対象を絞り込む
   
 
: <code>[x=''X'',y=''Y'',z=''Z'']</code> ― 指定した座標のターゲットを対象にする。合わせて半径も指定することで、指定した座標の周囲を対象にできる。
 
: <code>[x=''X'',y=''Y'',z=''Z'']</code> ― 指定した座標のターゲットを対象にする。合わせて半径も指定することで、指定した座標の周囲を対象にできる。
   
: 座標の値は正確な整数である必要がある - [[#チルダ表記法|チルダ表記法]] はこの引数では使えない。
+
: 座標の値は正確な整数である必要がある [[#チルダ表記法|チルダ表記法]]はこの引数では使えない。
   
;半径で対象を絞り込む
+
; {{anchor|半径で対象を絞り込む}}半径で対象を絞り込む
   
: <code>[r=''R'']</code> ― コマンドが実行された座標を中心に、半径''R''ブロック以内を対象とする。
+
: <code>[r=''R'']</code> ― コマンドが実行された座標を中心に、半径 ''R'' ブロック以内を対象とする。
: <code>[rm=''RM'']</code> ― コマンドが実行された座標を中心に、半径''RM''ブロック以上を対象とする。
+
: <code>[rm=''RM'']</code> ― コマンドが実行された座標を中心に、半径 ''RM'' ブロック以上を対象とする。
   
:合わせて座標の引数を使った場合は、コマンドを実行した場所よりも引数で指定した座標が優先される。 非常に遠い座標と非常に大きい半径を指定すれば、直線に近い範囲を対象にすることができる。
+
: 合わせて座標の引数を使った場合は、コマンドを実行した場所よりも引数で指定した座標が優先される。 非常に遠い座標と非常に大きい半径を指定すれば、直線に近い範囲を対象にすることができる。
   
;ゲームモードで絞り込む
+
; {{anchor|範囲で絞り込む}}範囲で絞り込む
   
 
: <code>[dx=''DX'',dy=''DY'',dz=''DZ'']</code>
: <code>[m=''M'']</code> ― 指定された[[ゲームモード]]の人だけを対象にする。
 
: <code>[m=!''M'']</code> ― 指定された[[ゲームモード]]'''以外'''の人を対象にする。
 
: 'M'に入る許可された値は以下のとおりである:
 
:* <code>-1</code>: 全てのゲームモード
 
:* <code>0</code>、<code>s</code>、<code>survival</code>: サバイバルモード
 
:* <code>1</code>、<code>c</code>、<code>creative</code>: クリエイティブモード
 
:* <code>2</code>、<code>a</code>、<code>adventure</code>: アドベンチャーモード
 
:* <code>3</code>、<code>sp</code>、<code>spectator</code>: [[スペクテイター]]モード
 
   
 
: コマンドが実行された座標、 またはコマンド内で指定された座標を中心とした特定の範囲のターゲットを対象にする。''DX'' "x" 方向(すなわち東 / 西)、 ''DY'' "y" 方向(すなわち上 / 下)、''DZ'' "z" 方向(すなわち北 / 南)の範囲を意味している。一緒に <code>x</code>、<code>y</code>、<code>z</code> の引数を指定した場合は、コマンドが実行された座標よりそれらを優先して範囲の北西の角とする<code>dx</code>、<code>dy</code>、<code>dz</code> は中心からの''距離''を示すものであり、別々の座標を指定するものではない)。
;数で絞り込む
 
   
 
: もし半径の引数と合わせて使った場合は、半径と範囲が重なった部分だけを対象とする(範囲の北西の角からの半径を指定でき、範囲の外は対象にならない)。
: <code>[c=''C'']</code> ― 指定された数のターゲットを対象とする。 コマンドが実行された場所からの距離の順に選ばれる。
 
   
 
; {{anchor|スコアの値で絞り込む}}スコアの値で絞り込む
: <code>@p</code> または <code>@r</code> セレクターでは、この<code>c</code>引数の値はデフォルトで1である。よって<code>c</code>引数を使うことで対象となるターゲットの数を'''増加'''させることができる。<code>@a</code> または <code>@e</code> セレクターと合わせて使えば、最寄りのターゲットを対象にできる。
 
   
 
: <code>[score_''スコア名''=''数値'']</code> ― ''スコア名'' ''数値'' 以上でない全てのターゲットを対象にする。
:もし同じ距離に複数のターゲットが存在した場合は、サーバーに存在した時間(最近のゲーム参加またはエンティティが作成されてからの時間)を基準に対象が選ばれる。最も時間が長いターゲットが優先して選ばれる。 例えば ''同じ距離に存在した場合'', <code>@a[c=1]</code> は最も長くサーバーに存在したターゲット一つを対象にし、 <code>@e[type=Creeper,c=3]</code> は3体の存在した時間が長いクリーパーが対象になる。
 
   
 
: <code>[score_''スコア名''_min=''最小値'']</code> ― ''スコア名'' ''最小値'' 未満でない全てのターゲットを対象にする。
: マイナスの値を指定した場合は、対象となる順番が反転する。 例えば、<code>@p[c=-3]</code> は3つの''最も遠い''プレイヤーを対象にする。もし対象にされうるターゲットが全て同じ距離に存在した場合は、<code>@e[c=-3]</code> は3つの最近参加した/作成されたターゲットが対象になる。
 
   
  +
: 例えば、<code>@a[score_points_min=30,score_points=39]</code> は ''points'' というスコアの値が30以上39以下のターゲットを対象にする(包括的に)。
;経験値レベルで絞り込む
 
   
 
{{see also|スコアボード#Objectives}}
: <code>[l=''L'']</code> ― レベルが''L''以上ではない全てのターゲットを対象にする。
 
   
  +
;{{anchor|タグで絞り込む}}タグで絞り込む
: <code>[lm=''LM'']</code> ― レベルが''LM''未満ではない全てのターゲットを対象にする。
 
   
  +
: <code>[tag=''タグ名'']</code> — スコアボードのタグ「タグ名」が与えられた対象のみを絞り込む。
;スコアの値で絞り込む
 
  +
: <code>[tag=!''タグ名'']</code> — スコアボードのタグ「タグ名」が与えられていない対象のみを絞り込む。
  +
: <code>[tag=]</code> — ''任意の''スコアボードのタグがない対象のみを絞り込む。
  +
: <code>[tag=!]</code> — ''任意の''スコアボードのタグがある対象のみを絞り込む。
   
 
{{see also|スコアボード#Tags_commands}}
: <code>[score_''スコア名''=''数値'']</code> ― ''スコア名''が''数値''以上でない全てのターゲットを対象にする。
 
   
 
; {{anchor|チームで絞り込む}}チームで絞り込む
: <code>[score_''スコア名''_min=''最小値'']</code> ― ''スコア名''が''最小値''未満でない全てのターゲットを対象にする。
 
   
: 例えば、<code>@a[score_points_min=30,score_points=39]</code> は''points''というスコアの値が30以上39以下のターゲットを対象にする(包括的に)
+
: <code>[team=''チーム名'']</code> ― 指定したチームに所属するターゲットを対象にする。
   
 
: <code>[team=!''チーム名'']</code> ― 指定したチームに所属''しない''ターゲットを対象にする。
{{see also|スコアボード#目的}}
 
   
 
: <code>[team=]</code> ― どのチームに所属していないターゲットを対象にする。
;チームで絞り込む
 
   
  +
{{see also|スコアボード#Teams}}
: <code>[team=''TEAM'']</code> ― 指定したチームに所属するターゲットを対象にする。
 
   
  +
; {{anchor|数で絞り込む}}数で絞り込む
: <code>[team=!''TEAM'']</code> ― 指定したチームに所属''しない''ターゲットを対象にする。
 
   
: <code>[team=]</code> ― チームにも所属していないターゲットを対象する。
+
: <code>[c=''C'']</code> ― 指定された数のターゲットを対象る。 コマンドが実行された場所からの距離の順に選ばれる。
   
 
: <code>@p</code> または <code>@r</code> セレクターでは、この <code>c</code> 引数の値はデフォルトで1である。よって <code>c</code> 引数を使うことで対象となるターゲットの数を'''増加'''させることができる。<code>@a</code> または <code>@e</code> セレクターと合わせて使えば、最寄りのターゲットを対象にできる。
{{see also|スコアボード#チーム}}
 
   
 
:もし同じ距離に複数のターゲットが存在した場合は、サーバーに存在した時間(最近のゲーム参加またはエンティティが作成されてからの時間)を基準に対象が選ばれる。最も時間が長いターゲットが優先して選ばれる。 例えば ''同じ距離に存在した場合''<code>@a[c=1]</code> は最も長くサーバーに存在したターゲット一つを対象にし、 <code>@e[type=creeper,c=3]</code> は3体の存在した時間が長いクリーパーが対象になる。
;名前で絞り込む
 
   
 
: マイナスの値を指定した場合は、対象となる順番が反転する。 例えば、<code>@p[c=-3]</code> は3つの''最も遠い''プレイヤーを対象にする。もし対象にされうるターゲットが全て同じ距離に存在した場合は、<code>@e[c=-3]</code> は3つの最近参加した/作成されたターゲットが対象になる。
: <code>[name=''NAME'']</code> ― ''NAME''という名前のターゲットを対象にする。
 
   
 
; {{anchor|経験値レベルで絞り込む}}経験値レベルで絞り込む
: <code>[name=!''NAME'']</code> ― ''NAME''という名前では''ない''ターゲットを対象にする。
 
   
 
: <code>[l=''L'']</code> ― レベルが ''L'' 以上ではない全てのターゲットを対象にする。
;範囲で絞り込む
 
   
 
: <code>[lm=''LM'']</code> ― レベルが ''LM'' 未満ではない全てのターゲットを対象にする。
: <code>[dx=''DX'',dy=''DY'',dz=''DZ'']</code>
 
   
  +
; {{anchor|ゲームモードで絞り込む}}ゲームモードで絞り込む
: コマンドが実行された座標、 またはコマンド内で指定された座標を中心とした特定の範囲のターゲットを対象にする。''DX''は"x"方向(すなわち東/西)、 ''DY''は"y"方向(すなわち上/下)、''DZ''は"z" 方向(すなわち北/南)の範囲を意味している。一緒に <code>x</code>、<code>y</code>、<code>z</code> の引数を指定した場合は、コマンドが実行された座標よりそれらを優先して範囲の北西の角とする (<code>dx</code>、<code>dy</code>、<code>dz</code> は中心からの''距離''を示すものであり、別々の座標を指定するものではない)。
 
   
 
: <code>[m=''M'']</code> ― 指定された[[ゲームモード]]の人だけを対象にする。
: もし半径の引数と合わせて使った場合は、半径と範囲が重なった部分だけを対象とする(範囲の北西の角からの半径を指定でき、範囲の外は対象にならない)。
 
 
: <code>[m=!''M'']</code> ― 指定された[[ゲームモード]]'''以外'''の人を対象にする。
 
: 'M' に入る許可された値は以下のとおりである:
 
:* <code>-1</code>: 全てのゲームモード
 
:* <code>0</code>、<code>s</code>、<code>survival</code>: サバイバルモード
 
:* <code>1</code>、<code>c</code>、<code>creative</code>: クリエイティブモード
 
:* <code>2</code>、<code>a</code>、<code>adventure</code>: アドベンチャーモード
 
:* <code>3</code>、<code>sp</code>、<code>spectator</code>: [[スペクテイター]]モード
  +
  +
; {{anchor|名前で絞り込む}}名前で絞り込む
  +
 
: <code>[name=''NAME'']</code> ― ''NAME'' という名前のターゲットを対象にする。
  +
 
: <code>[name=!''NAME'']</code> ― ''NAME'' という名前では''ない''ターゲットを対象にする。
   
;縦向きの回転で絞り込む
+
; {{anchor|縦向きの回転で絞り込む}}縦向きの回転で絞り込む
   
: <code>[rx=''RX'']</code> ― 縦向きの回転の値が''RX''以下のターゲットを対象にする。
+
: <code>[rx=''RX'']</code> ― 縦向きの回転の値が ''RX'' 以下のターゲットを対象にする。
: <code>[rxm=''RXM'']</code> ― 縦向きの回転の値が''RXM''以上のターゲットを対象にする。
+
: <code>[rxm=''RXM'']</code> ― 縦向きの回転の値が ''RXM'' 以上のターゲットを対象にする。
   
 
: 縦向きの回転の値は-90.0(真上を向いた際の数値)から90.0(真下を向いた際の数値)の間で変化する(したがって、下向きの回転で値が増加する)。
 
: 縦向きの回転の値は-90.0(真上を向いた際の数値)から90.0(真下を向いた際の数値)の間で変化する(したがって、下向きの回転で値が増加する)。
   
;水平方向の回転で絞り込む
+
; {{anchor|水平方向の回転で絞り込む}}水平方向の回転で絞り込む
   
: <code>[ry=''RY'']</code> ― 水平方向の回転の値が''RY''以下のターゲットを対象にする。
+
: <code>[ry=''RY'']</code> ― 水平方向の回転の値が ''RY'' 以下のターゲットを対象にする。
: <code>[rym=''RYM'']</code> ― 水平方向の回転の値が''RYM''以上のターゲットを対象にする。
+
: <code>[rym=''RYM'']</code> ― 水平方向の回転の値が ''RYM'' 以上のターゲットを対象にする。
   
 
: 水平方向の回転の値は-180.0(北を向いた際の値)から-90.0(東を向いた際の値)、0.0(南を向いた際の値)、90.0(西を向いた際の値)、179.9(北の少し西を向いた際の値)、そして-180.0に戻ってくるまで変化する。(したがって、右方向すなわち時計回りに回転すると値は増加する)。
 
: 水平方向の回転の値は-180.0(北を向いた際の値)から-90.0(東を向いた際の値)、0.0(南を向いた際の値)、90.0(西を向いた際の値)、179.9(北の少し西を向いた際の値)、そして-180.0に戻ってくるまで変化する。(したがって、右方向すなわち時計回りに回転すると値は増加する)。
   
;種類で絞り込む
+
; {{anchor|種類で絞り込む}}種類で絞り込む
   
 
: <code>[type=''TYPE'']</code> ― 指定した種類のエンティティを対象にする。
 
: <code>[type=''TYPE'']</code> ― 指定した種類のエンティティを対象にする。
 
: <code>[type=!''TYPE'']</code> ― 指定した種類では''ない''エンティティを対象にする。
 
: <code>[type=!''TYPE'']</code> ― 指定した種類では''ない''エンティティを対象にする。
   
: ''TYPE''は内部的なエンティティの種類を指定する[[データ値#エンティティID|エンティティID]]である必要がある(例えば、<code>Creeper</code>は[[クリーパー]]、<code>MinecartRideable</code>は通常の[[トロッコ]]、<code>PrimedTnt</code>は着火された[[TNT]]、など)。 エンティティIDは大文字と小文字が区別され、間違ったIDを指定するとコマンドの実行に失敗する。
+
: ''TYPE'' は内部的なエンティティの種類を指定する[[データ値#エンティティID|エンティティID]]である必要がある(例えば、<code>creeper</code>は[[クリーパー]]、<code>minecart</code>は通常の[[トロッコ]]、<code>tnt</code>は着火された[[TNT]]、など)。 エンティティIDは大文字と小文字が区別され、間違ったIDを指定するとコマンドの実行に失敗する。
   
: <code>@r</code>セレクターと合わせて使えば、<code>@r</code>セレクターの対象をプレイヤーから他のエンティティに変更することが出来る。
+
: <code>@r</code> セレクターと合わせて使えば、<code>@r</code> セレクターの対象をプレイヤーから他のエンティティに変更することが出来る。
   
 
=== データタグ ===
 
=== データタグ ===

2017年7月17日 (月) 04:43時点における版

Book and Quill
このページの内容は翻訳されていません。 
あなたが内容を翻訳してみませんか?
Clock JE3
この記事は内容の更新を必要とします。 
この記事を更新して、最近のアップデートや新たな情報を反映してください。
Information icon
この項目はJava EditionPocket Edition、およびMinecraft Education限定の要素です。 
この記事では、コンソールコマンドについて説明しています。コマンドを実行するブロックについては「コマンドブロック」を、コマンドを実行するトロッコについては「コマンドブロック付きトロッコ」をご覧ください。

コマンド (Command) は、Java Edition および Pocket Edition に存在する、定められた構文に従って書かれた高度な機能を持つテキストである。

使用方法

通常の Minecraftクライアントでは、T キーを押すか直接 / キーを入力してチャット画面を開いて入力する。/ キーを使ってチャット画面を開いた場合は、コマンドの先頭のスラッシュが最初から入力された状態でチャット画面が開く。 キーを使用して、以前に実行したコマンドを入力できる。コマンドを入力中に Tab ↹ キーを押すと、使用可能なコマンドや引数、見ているブロックの座標が表示され、そのまま使用できる。

コマンドはサーバーのコンソールで使用することもできるが、その場合はコマンドには /不要である。この方法でサーバー管理者がコマンドを実行することを「Ghosting」と呼ぶ。

コマンドブロックから実行されるコマンドにスラッシュ記号をつけてもよいが、必須ではない。また、コマンドブロック内のコマンドは追加でオプションの変数を記述する必要がある場合がある。その変数には、一般的にはプレイヤー名などが当てはまる。

大多数のコマンドは、以下の状況でのみ有効である

  • マルチプレイサーバーにて、管理者またはコマンドブロックによって実行された場合
  • その他のマルチプレイでは、「LAN に開く」からチートを有効にしてローカルマルチプレイを開始した場合、または自分でサーバーをホスティングしている場合
  • シングルプレイで、ワールド生成時にチートを有効にした場合(「その他のワールドオプション」ボタンから設定する)

いくつかのコマンドは、シングルプレイにおいてチートが有効でなくとも実行できる。

注意:シングルプレイでワールドを作成時にチートを有効にしなかった場合でも、ローカルマルチプレイを開始する際にチートを有効にするとコマンドが使えるようになる(Esc → 「LAN に開く」 → 「チートを許可する:オン」)。この際他のプレイヤーがゲームに参加する必要はない。ワールドを出るとコマンドは使えなくなるが、コマンドを使ってワールドに加えた変更はそのまま保持される。ワールドに入る度に同じ手順を繰り返せばよい。ローカルマルチプレイを開始するとゲームを一時停止できなくなるので注意。ワールドから出ればローカルマルチプレイは終了される。

チルダ表記法

多数のコマンドではチルダ~ 記号で「相対座標」を使うことができる。チルダ記号と一緒に書かれた数字は、コマンドで指定した座標からの「オフセット」であり、+- の符号で正負の方向を指定する。~ 一文字で ~0 を表す。

例えば、 tp 0 64 0 というコマンドではプレイヤーを x:0、y:64、z:0 の位置へテレポートするが、tp ~3 ~ ~-3 というコマンドではプレイヤーをX方向へ「+3」(つまり東へ3ブロック分)、高さはそのまま、そしてZ方向へ「-3」(つまり北へ3ブロック分)テレポートさせる。

絶対座標は相対座標と一緒に使うことが出来る。例えば、tp ~ 64 ~ は X 座標と Z 座標はそのままに、Y 座標:64 へテレポートさせるコマンドである。

相対座標の原点はそれぞれのコマンドに依存する。例えば /tp コマンドの原点はテレポート開始時の座標である。その他のコマンドでは、原点はコマンドが実行された座標、またはコマンドで特別に指定した座標である。

ターゲットセレクター

大多数のコマンドでは、プレイヤー名でプレイヤーを指定する代わりに、条件を満たす一人もしくはそれ以上のプレイヤーを指定できる。条件でプレイヤーを指定する場合は、「ターゲットセレクター」の種類を選び、必要に応じて、満たされるべき条件を引数として追加できる。

例えば以下のコマンドでは、「Red」チームに所属する全てのプレイヤーのゲームモードをクリエイティブモードに変更する。各プレイヤー名を個別に指定するより効率的である: /gamemode creative @a[team=Red]


ターゲットセレクターの種類

ターゲットセレクターの種類の概要
変数 働き
@p 最寄りのプレイヤー1人
@r ランダムなプレイヤー
@a 全てのプレイヤー
@e 全てのエンティティ
@s コマンドを実行しているエンティティ

ターゲットセレクターの種類によって幅広い対象を識別する。変数は4種類ある:

@p
最も近い一人のプレイヤーが対象になる。 もしも複数のプレイヤーが正確に同じ距離に存在した場合は、サーバーに最近参加したプレイヤーが優先して選ばれる。
ターゲットセレクターの引数を使って、対象となるプレイヤーをさらに絞り込める。例えば @p[team=Red] とすれば最も近い「Red」チームのプレイヤーを対象にする。さらに近くにプレイヤーが居たとしても、チームが違うならば対象にならない。
引数 c を使えば、対象になるプレイヤーの人数を増やすことが出来る(例えば @p[c=3] なら最寄りの3人のプレイヤーが対象になる)。c にマイナスの値を設定した場合は、対象を選ぶ優先順位が逆になる(例えば、@p[c=-1] だと最も遠いプレイヤーを対象にする)。
@r
ランダムなプレイヤーを対象にする(type 引数を使えばランダムなエンティティも対象になる)。
ターゲットセレクターの引数を使って、対象となるプレイヤーを絞り込むことが出来る。 例えば、@r[team=Red] は「Red」チームのプレイヤーの中からランダムで一人を対象にする。
c 引数を使えば対象になるプレイヤーの人数を増やせる。例えば、@r[c=3] はランダムに3人のプレイヤーを対象にする。
type 引数を使わない場合は、@r は常時プレイヤーを対象とする。 type 引数を使えばプレイヤー以外のエンティティを対象にできる(例えば、@r[type=zombie] はランダムなゾンビを対象にする。@r[type=!player] はプレイヤー以外のエンティティをランダムで対象にする。@r[type=!zombie] はゾンビ以外からランダムで対象にする)。
@a
死んだプレイヤーも含めて、全てのプレイヤーを対象にする。これ以外に死んだプレイヤーを対象にするセレクターはない。
ターゲットセレクターの引数を使って、対象にするプレイヤーを絞り込むことができる。例えば、@a[team=Red] は「Red」チーム内の全プレイヤーを対象にする。
@e
全てのエンティティを対象にする(プレイヤーも含める)。
ターゲットセレクターの引数を使って、対象にするエンティティを絞り込むことが出来る。 例えば、@e[type=cow]ウシだけを対象にする。
@s
1つのエンティティのみを対象とする(死亡したプレイヤーを含む、コマンドを実行したエンティティ)。実行者がエンティティでない場合、例えば実行者がコマンドブロックまたはサーバーコンソールであった場合、このセレクターは何も機能しないん。
ターゲットセレクターの引数を使って、対象となるプレイヤーをさらに絞り込める。例えば、@s[type=cow,team=Red] は実行者が「Red」チームのウシだった場合、コマンドの実行者を対象にする。


ターゲットセレクターの引数

ターゲットセレクターの引数の概要
ポジションによる選択
引数 選択基準
x, y, z 座標
r, rm 半径(最大、最小)
dx, dy, dz 範囲の大きさ
スコアボード値による選択
引数 選択基準
score_name 最大スコア
score_name_min 最小スコア
tag スコアボードのタグ
team チーム名
特徴による選択
引数 選択基準
c
l, lm 経験値レベル(最大、最小)
m ゲームモード
name エンティティ名
rx, rxm X 軸を中心とした向き(最大、最小)
ry, rym Y 軸を中心とした向き (最大、最小)
type エンティティの種類

ターゲットセレクターの後に引数を追記することで、選択基準をさらに編集することが出来る。 @a または @e セレクターと一緒に使えば、全ての中から特定の限られた対象に絞り込むことが出来る。@p または @r セレクターと一緒に使えば、最寄りのまたはランダムに選ばれた対象の中からさらに絞り込むことが出来る。

引数はセレクターの後に四角括弧を追記し、その中にコンマで区切って値を書く:

@<セレクター>[<引数>=<>,<引数>=<>,…].

括弧の中のスペースは無効であり、引数の値を区切るにはコンマだけが有効である。

引数では大文字と小文字は区別され、未知の引数を書いた場合は無視される。例えば、kill @e[type=creeper,r=20] は半径20ブロック以内の全てのクリーパーをキルするが、 kill @e[Type=creeper,r=20] ('type' 内の 'T' が大文字)と書くとクリーパーだけを指定するはずの 'type' の書き方が間違っているため、半径20ブロック以内の全てのエンティティがキルされる。

xyzr の4つの引数は、最初に書く場合は単純に数値だけを書いて指定できる。したがって、以下の2つのコマンドは同じ意味である:

/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 ブロック以上を対象とする。
合わせて座標の引数を使った場合は、コマンドを実行した場所よりも引数で指定した座標が優先される。 非常に遠い座標と非常に大きい半径を指定すれば、直線に近い範囲を対象にすることができる。
範囲で絞り込む
[dx=DX,dy=DY,dz=DZ]
コマンドが実行された座標、 またはコマンド内で指定された座標を中心とした特定の範囲のターゲットを対象にする。DX は "x" 方向(すなわち東 / 西)、 DY は "y" 方向(すなわち上 / 下)、DZ は "z" 方向(すなわち北 / 南)の範囲を意味している。一緒に xyz の引数を指定した場合は、コマンドが実行された座標よりそれらを優先して範囲の北西の角とする(dxdydz は中心からの距離を示すものであり、別々の座標を指定するものではない)。
もし半径の引数と合わせて使った場合は、半径と範囲が重なった部分だけを対象とする(範囲の北西の角からの半径を指定でき、範囲の外は対象にならない)。
スコアの値で絞り込む
[score_スコア名=数値]スコア名数値 以上でない全てのターゲットを対象にする。
[score_スコア名_min=最小値]スコア名最小値 未満でない全てのターゲットを対象にする。
例えば、@a[score_points_min=30,score_points=39]points というスコアの値が30以上39以下のターゲットを対象にする(包括的に)。
タグで絞り込む
[tag=タグ名] — スコアボードのタグ「タグ名」が与えられた対象のみを絞り込む。
[tag=!タグ名] — スコアボードのタグ「タグ名」が与えられていない対象のみを絞り込む。
[tag=]任意のスコアボードのタグがない対象のみを絞り込む。
[tag=!]任意のスコアボードのタグがある対象のみを絞り込む。
チームで絞り込む
[team=チーム名] ― 指定したチームに所属するターゲットを対象にする。
[team=!チーム名] ― 指定したチームに所属しないターゲットを対象にする。
[team=] ― どのチームにも所属していないターゲットを対象にする。
数で絞り込む
[c=C] ― 指定された数のターゲットを対象とする。 コマンドが実行された場所からの距離の順に選ばれる。
@p または @r セレクターでは、この c 引数の値はデフォルトで1である。よって c 引数を使うことで対象となるターゲットの数を増加させることができる。@a または @e セレクターと合わせて使えば、最寄りのターゲットを対象にできる。
もし同じ距離に複数のターゲットが存在した場合は、サーバーに存在した時間(最近のゲーム参加またはエンティティが作成されてからの時間)を基準に対象が選ばれる。最も時間が長いターゲットが優先して選ばれる。 例えば 同じ距離に存在した場合@a[c=1] は最も長くサーバーに存在したターゲット一つを対象にし、 @e[type=creeper,c=3] は3体の存在した時間が長いクリーパーが対象になる。
マイナスの値を指定した場合は、対象となる順番が反転する。 例えば、@p[c=-3] は3つの最も遠いプレイヤーを対象にする。もし対象にされうるターゲットが全て同じ距離に存在した場合は、@e[c=-3] は3つの最近参加した/作成されたターゲットが対象になる。
経験値レベルで絞り込む
[l=L] ― レベルが L 以上ではない全てのターゲットを対象にする。
[lm=LM] ― レベルが LM 未満ではない全てのターゲットを対象にする。
ゲームモードで絞り込む
[m=M] ― 指定されたゲームモードの人だけを対象にする。
[m=!M] ― 指定されたゲームモード以外の人を対象にする。
'M' に入る許可された値は以下のとおりである:
  • -1: 全てのゲームモード
  • 0ssurvival: サバイバルモード
  • 1ccreative: クリエイティブモード
  • 2aadventure: アドベンチャーモード
  • 3spspectator: スペクテイターモード
名前で絞り込む
[name=NAME]NAME という名前のターゲットを対象にする。
[name=!NAME]NAME という名前ではないターゲットを対象にする。
縦向きの回転で絞り込む
[rx=RX] ― 縦向きの回転の値が RX 以下のターゲットを対象にする。
[rxm=RXM] ― 縦向きの回転の値が RXM 以上のターゲットを対象にする。
縦向きの回転の値は-90.0(真上を向いた際の数値)から90.0(真下を向いた際の数値)の間で変化する(したがって、下向きの回転で値が増加する)。
水平方向の回転で絞り込む
[ry=RY] ― 水平方向の回転の値が RY 以下のターゲットを対象にする。
[rym=RYM] ― 水平方向の回転の値が RYM 以上のターゲットを対象にする。
水平方向の回転の値は-180.0(北を向いた際の値)から-90.0(東を向いた際の値)、0.0(南を向いた際の値)、90.0(西を向いた際の値)、179.9(北の少し西を向いた際の値)、そして-180.0に戻ってくるまで変化する。(したがって、右方向すなわち時計回りに回転すると値は増加する)。
種類で絞り込む
[type=TYPE] ― 指定した種類のエンティティを対象にする。
[type=!TYPE] ― 指定した種類ではないエンティティを対象にする。
TYPE は内部的なエンティティの種類を指定するエンティティIDである必要がある(例えば、creeperクリーパーminecartは通常のトロッコtntは着火されたTNT、など)。 エンティティIDは大文字と小文字が区別され、間違ったIDを指定するとコマンドの実行に失敗する。
@r セレクターと合わせて使えば、@r セレクターの対象をプレイヤーから他のエンティティに変更することが出来る。

データタグ

A data tag is a sequence of text which describes a data structure using attribute-value pairs. Data tags are used in Computer Edition commands to specify complex data for players, entities, and some blocks.

A data tag consists of zero or more attribute-value pairs separated by commas and delineated by curly brackets. Each attribute-value pair consists of an attribute name and the attribute's value, separated by a colon. Some values, however, may themselves contain attribute-value pairs, allowing a data tag to describe a hierarchical data structure.

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

The data structures that data tags describe are the same ones used in Minecraft's save files. These data structures are described in other articles and commands expect data tags to use the same attribute names (which are case-sensitive):

Data Structure Specification Links
Objects Examples
Block entities chests, furnaces, command blocks, mob spawners, signs, etc.
Items items in inventories (includes specifications for enchantments, lore, custom names, etc.)
Item entities items on the ground
Mobs creepers, cows, villagers, etc.
Projectiles arrows, fireballs, thrown potions, etc.
Vehicles boats, minecarts, etc.
Dynamic tiles primed TNT, falling sand/gravel/anvils
Other entities firework rockets, paintings, and item frames

The defined data structures also expect the values to be of the correct type.

Data Tags Value Types
Type Description
 Byte An integer between -128 and 127 (inclusive).
 Short An integer between -32,768 and 32,767 (inclusive).
 Int An integer between -2,147,483,648 and 2,147,483,647 (inclusive).
 Long An integer between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807 (inclusive).
 Float
 Double
Float - 32-bit single-precision floating point, Example: 3.1415926

Double - 64-bit double-precision floating point, Example: 3.141592653589793

See https://en.wikipedia.org/wiki/IEEE_floating_point for details.

 String A sequence of text, optionally delineated with double quotes.

Double quotes must be used if the String contains commas, curly brackets, or square brackets. To include a double quote inside a String, add a backslash before the double quote.

Example: "Call me \"Ishmael\""
 List A sequence of values, separated by commas and delineated with square brackets. The values must be of the same type, which is dictated by the first value in the sequence.
Example: [3.2,64.5,129.5]
 Int Array A sequence of integers between -2,147,483,648 and 2,147,483,647 (inclusive), separated by commas and delineated with square brackets.
 Compound A sequence of attribute-value pairs, separated by commas and delineated with curly brackets.
Example: {X:3,Y:64,Z:129}

Every data tag argument is itself a Compound.

The  Byte Array type is unavailable to commands.

Some commands may require that a number's type be specified by adding a letter (B, S, L, F, D) to the end of the value. For example, 3s for a short, 3.2f for a float, etc. (This doesn't work with I for int.) The letter can be uppercase or lowercase. When no letter is used and Minecraft can't tell the type from context, it assumes double (if there's a decimal point), int (if there's no decimal point and the number is small enough to store as an int), or string (if neither is true). A square-bracketed literal is assumed to be an int array if every element that's between commas is an int; otherwise, it is assumed to be a list. An exception applies: [] is an empty list, but [,] is an empty int array.

When commands such as /testfor, /testforblock, and /clear are used to match data tags, they only check for the presence of the provided tags in the target entity/block/item. This means that the entity/block/item may have additional tags and will still match. This is true even for lists and arrays: the order of a list is not acknowledged, and as long as every requested element is in the list, it will match even if there are additional elements.

The format used for data tags is a lenient form of JSON.

JSONテキスト

The /tellraw and /title commands use strict JSON syntax.

Scores and target selectors are evaluated for a Sign when it is placed or edited and for a Written Book when it is "resolved" (opened for the first time after signing). They won't update after that, and they won't work if edited onto an existing sign with an NBT editor, or onto a book that's already marked resolved. There's no way to wrap text onto the next line of a sign or the next page of a book during resolution; instead, the extra text will simply disappear.

The format of raw JSON text is a JSON Object which supports the following (mostly optional) elements:

  • The base chat component Object
    •  text: A string representing raw text to display directly in chat. Note that selectors such as "@a" and "@p" are not translated into player names; use selector instead. "\n" is newline (enter).
    •  extra: A list of additional objects, sharing the same format as the base object.
      • A list element with the same format as the base object (recursive). Note that all properties of this object are inherited by children except for text, extra, translate, with, and score. This means that children will retain the same formatting and events as this object unless they explicitly override them.
    •  color: The color to render this text in. Valid values are "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white", and "reset" (cancels out the effects of colors used by parent objects). Technically, "bold", "underline", "italic", "strikethrough", and "obfuscated" are also accepted, but it may be better practice to use the tags below for such formats.
    •  bold: Boolean (true/false) - whether to render text in bold. Defaults to false.
    •  underlined: Boolean (true/false) - whether to render text underlined. Defaults to false.
    •  italic: Boolean (true/false) - whether to render text in italics. Defaults to false.
    •  strikethrough: Boolean (true/false) - whether to render text with a strikethrough. Defaults to false.
    •  obfuscated: Boolean (true/false) - whether to render text obfuscated. Defaults to false.
    •  insertion: When the text is shift-clicked by a player, this string will be inserted in their chat input. It will not overwrite any existing text the player was writing.
    •  clickEvent: Allows for events to occur when the player clicks on text.
      •  action: The action to perform when clicked. Valid values are "open_url" (opens value as a URL in the player's default web browser), "open_file" (opens the value file on the users computer), "twitch_user_info" (opens info about a twitch user), "run_command" (has value entered in chat as though the player typed it themselves. This can be used to run commands, but the command will fail if the player does not have the required permissions to use it), "change_page" (can only be used in written books) changes to page value if that page exists, and "suggest_command" (similar to "run_command", but the text only appears in the player's chat input, and is not automatically entered. Unlike insertion, this will replace the existing contents of the chat input). "open_file" and "twitch_user_info" cannot be used with commands.
      •  value: The URL, file, twitch user, chat, command or book page used by the specified action. Note that commands must be prefixed with the usual "/" slash.
    •  hoverEvent: Allows for a tooltip to be displayed when the player hovers their mouse over text.
      •  action: The type of tooltip to show. Valid values are "show_text" (shows raw JSON text), "show_item" (shows the tooltip of an item which can have NBT tags), "show_achievement" (shows formatted text describing an achievement or statistic. Normal achievement names are green, final achievement names are dark_purple, and statistic names are gray. In addition, a description is given for achievements), and "show_entity" (shows an entity's name, possibly its type, and its UUID).
      •  value: The formatting of this tag varies depending on the action. Note that "show_text" is the only action to support an Object as the value; all other action values are Strings and should thus be wrapped in quotes.
        • "show_text": Can be either a raw String of text, or an Object with the same formatting as this base object. Note that clickEvent and hoverEvent do not function within the tooltip, but the formatting and extra tags still work.
        • "show_item": A string formatted like item NBT data. Contains the "id" tag, and optionally the "Damage" tag and "tag" tag (which is the same compound used as "dataTag" in the /give command).
        • "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 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 reader'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. Clicking a player's name inserted into a /tellraw command this way will suggest a command to whisper to that player. Shift-clicking a player's name will insert that name into chat. Shift-clicking a non-player entity's name will insert its UUID into chat.

Due to the extra tag, the above format may be recursively nested to produce very complex and functional text strings. However, a raw json text doesn't have to be complicated at all: virtually all properties are optional and may be left out.

To be valid, each object must have at least either text, translate, score or selector (everything else is optional). As a matter of shorthand, however, the entire Object may be substituted with a String. In this case, that string will be considered the value of the text property. For example, "This is raw text" is equivalent to {text:"This is raw text"}. This shorthand substitution is valid anywhere a raw text object is required (including the base <raw json message> argument of /tellraw, the elements of the extra list, and the value of a "show_text" hover_event).

/tellraw also accepts an array of objects and/or strings; they are concatenated. It even accepts a tree of nested arrays; they are traversed depth-first. For example:

/tellraw @a ["Hello there, ",{selector:"@p"},"."]
/tellraw @a [[[["The "],[["quick ","brown "],[{selector:"@p"}," jumps "],"over "],"the "],["lazy ","dog."]]]

Finally, unlike other commands using JSON, /tellraw Strings support Unicode via the notation \u####, where #### is the Unicode hexadecimal number for the desired character.

External links
Skylinerw's JSON Formatting Examples
Tellraw Generator

ブロック/アイテム名

コマンドの中には引数に特定のブロック・アイテムのIDを必要とするものが多くある。 以下のコマンド構文において通常では、<Block><TileName><Item>などの要素として表示され、例のようにminecraft:stoneなどのIDに置き換えられる。PC版ではそれらのIDには"minecraft:"を付ける必要がある。Pocket Editionでは付ける必要は無い。

各コマンドの概要

以下の表は、各コマンドの概要を示している。行ごとに並べ替え出来る。

コマンドの概要
コマンド 説明 OPレベル MP限定 PE EE
/ability プレイヤーに能力を付与または取り消す。 0 EE限定
/achievement プレイヤーに実績を与えたり削除したりする。 2
/advancement プレイヤーに進捗を与えたり削除したりチェックしたりする。 2
/ban BAN一覧にプレイヤーを追加する。 3 MP
/ban-ip BAN一覧にIPアドレスを追加する。 3 MP
/banlist BAN一覧を表示する。 3 MP
/blockdata ブロックのデータタグを編集する。 2
/clear プレイヤーのインベントリからアイテムを消去する。 2 はい ?
/clone ブロックのまとまりをコピー/移動させる。 2 はい ?
/debug デバッグを開始/停止する。 3
/defaultgamemode デフォルトのゲームモードを設定する。 2
/deop プレイヤーの管理者権限を削除する。 3 MP はい ?
/difficulty 難易度を設定する。 2 はい ?
/effect ステータス効果を付与/削除する。 2 はい ?
/enchant プレイヤーのアイテムをエンチャントする。 2 はい ?
/entitydata エンティティのデータタグを編集する。 2
/execute プレイヤー/エンティティにコマンドを実行させる。 2 はい ?
/fill ブロックを一括で設置する。 2 はい ?
/function 関数を実行する。 2
/gamemode プレイヤーのゲームモードを設定する。 2 はい ?
/gamerule ゲームルールを設定する。 2 はい はい
/give プレイヤーにアイテムを与える。 2 はい ?
/help コマンドのヘルプを表示する。 0 はい ?
/kick プレイヤーをキックする。 3 MP
/kill エンティティ(プレイヤー、Mob、アイテムなど)をキル(抹消)する。 2 はい ?
/list サーバーのプレイヤー一覧を表示する。 0 MP はい ?
/locate 最も近い構造物の座標を表示する。 2 はい ?
/me 自分自身に関するメッセージを表示する。 0 はい ?
/op プレイヤーに管理者権限を与える。 3 MP はい ?
/pardon BAN一覧から項目を削除する。 3 MP
/particle パーティクルを表示する。 2 ?
/playsound サウンドを再生する。 2 はい ?
/publish ワールドをローカルのネットワークに開放する。 4 SP限定 ?
/recipe プレイヤーのレシピを解除したり、ロックしたりする。 2 ?
/reload ルートテーブル、進捗、関数をディスクから再読み込みする。 4 ?
/replaceitem インベントリのアイテムを置き換える。 2 はい ?
/save-all サーバーのワールドをセーブする。 4 MP ?
/save-off サーバーの自動セーブを無効にする。 4 MP ?
/save-on サーバーの自動セーブを有効にする。 4 MP ?
/say 複数のプレイヤーにメッセージを表示する。 2 はい ?
/scoreboard オブジェクト、プレイヤー、チーム、タグを管理する。 2 ?
/seed シード値を表示する。 2 ?
/setblock ブロックを設置/置換する。 2 はい ?
/setidletimeout アイドル状態のプレイヤーがキックされる時間を設定する。 3 MP ?
/setmaxplayers 参加が許可されているプレイヤーの最大数を設定する。 0 PE限定 ?
/setworldspawn ワールドのスポーン地点を設定する。 2 はい ?
/spawnpoint プレイヤーのスポーン地点を設定する。 2 はい ?
/spreadplayers エンティティをランダムな場所に配置する。 2 はい ?
/stats コマンドの結果を使ってオブジェクトを更新する。 2 ?
/stop サーバーを停止する。 4 MP ?
/stopsound サウンドを停止する。 2 はい ?
/summon エンティティを召喚する。 2 はい ?
/teleport エンティティをテレポートさせる。 2 はい ?
/tell 他のプレイヤーにプライベートメッセージを送信する。 0 はい ?
/tellraw プレイヤーにJSONテキストを表示する。 2 ?
/testfor 条件に合うエンティティを検知する。 2 はい ?
/testforblock 特定の位置に指定したブロックがあるかどうかを検知する。 2 はい ?
/testforblocks 2つのブロックのまとまりが一致するかを検知する。 2 はい ?
/time ワールドの時間の数値を変更する。 2 はい ?
/title 画面に表示するタイトルを管理する。 2 はい ?
/toggledownfall 天候を交互に切り替える。 2 はい ?
/tp エンティティをテレポートさせる。 2 はい ?
/transferserver プレイヤーをサーバーに転送する。 0 PE限定 ?
/trigger トリガー型オブジェクトを使用する。 0 ?
/weather 天候を設定する。 2 はい ?
/whitelist サーバーのホワイトリストを設定する。 3 MP ?
/worldborder ワールドの境界を管理する。 2 ?
/wsserver WebSocketサーバーに接続する。 0 PE限定 ?
/xp プレイヤーの経験値を追加/削除する。 2 はい ?

コマンド一覧 (英語版準拠)

この節は翻訳途中です。 
あなたが内容を翻訳してみませんか?
以下の解説で使う構文
解説内の書き方 意味
プレーンテキスト 書かれているまま、文字通り入力する。
斜体 適切な値で置き換える。
<山括弧で囲まれた文字> 必要な引数を表している。
[四角括弧で囲まれた文字] 任意の引数を表している。
x|y

示されている文字のどちらか一つを書く。

有効な文字列は | で区切って示されている。

省略記号 … この引数はスペースで区切られたいくつかの言葉から成り立つ。
実行が成功する条件
コマンドの成功条件は、ゲームがコマンドを"成功した"かどうかを考えるために満たされなければいけない。これはコマンドブロックからレッドストーンコンパレーターに信号が出力されるかなど、様々な物事の決定に使われる。全ての"成功した"コマンドが実際に様々な事を行うわけではないし、全ての"失敗した"コマンドが様々な事をうまく実行できないわけではないことに注意。
制限事項
以下の解説では、コマンドを誰が、またはどのような状況で使用できるかを「制限」の欄に記している。それについて説明する。
  • なし: これらのコマンドはどんなワールドでもどんなプレイヤーでも使える。/help/me/tell/trigger コマンドが該当する。
  • オペレーター: これらのコマンドはop(オペレーター) もしくはチートが有効なシングルプレイのプレイヤーのみ使える。マルチプレイサーバーでは、このコマンドの結果は他のオンラインのopに伝えられる。
No multiplayer commands permit target selectors in arguments.
/listコマンドを除いて、マルチプレイ専用コマンドはコマンドブロックでは使えない。
マルチプレイ専用コマンドの多数は、サーバーに参加したことがない、またはMinecraftアカウントとして存在しないプレイヤーに対して実行できる。


achievement

コマンド
必要権限レベル

不明

実行制限

なし

プレイヤーに実績や統計の値を与える。

構文
achievement <give|take> <stat_name|*> [player]
引数
stat_name
編集する実績または統計を指定する:
  • achievement.achievement_name achievement_name には正しい統計の識別名が入る
  • * は全ての実績を表す
player (任意)
プレイヤー名またはターゲットセレクターを書く。書かない場合は実行したプレイヤー自身がターゲットになる。コマンドブロックでは記述が必須。
結果
引数の値が正しくない場合やプレイヤーが特定できなかった場合は失敗する。
成功すれば、指定した実績(とその解除に必要な全ての実績)が解除/リセットされる。統計を指定した場合は、指定した統計の値が1づつ増加/減少する。
"オーバーキル"の実績を解除: achievement give achievement.overkill
Aliceの"インベントリを開く"実績を解除: achievement give achievement.openInventory Alice
最寄りのプレイヤーの"モブを殺した回数"の統計を1増やす: achievement give stat.mobKills @p
全てのプレイヤーの全ての実績をリセットする: achievement take * @a


advancement

コマンド
必要権限レベル

不明

実行制限

なし

Gives or takes an advancement from a player, or tests whether a player has an advancement.

Syntax
advancement <grant|revoke> <player> <only|until|from|through> <advancement> [criterion]
advancement <grant|revoke> <player> everything
advancement test <player> <advancement> [criterion]
Arguments
player
Must be a player name or a target selector.
only
Grants/revokes only the specified advancement from the player.
until
Grants/revokes the specified advancement, its parent advancement, its parent's parent advancement, etc. from the player. From the start until the specified advancement.
from
Grants/revokes the specified advancement, its children advancements, its children's children advancements, etc. from the player. All the way forward from the specified advancement.
through
Acts as until and from combined; all advancements through the specified advancement, going both backwards and forwards.
everything
Grants/revokes every loaded advancement from the player.
advancement
Specifies which advancement to grant, revoke or test. Must be a valid advancement identifier.
criterion (optional)
Specifies which criterion of the advancement to grant, revoke or test. Must be a valid advancement criteria identifier.
If specified, the command will refer to merely the criterion, and not the entire advancement.
If absent, the command will refer to the entire advancement.
Result
Fails if the arguments aren't specified correctly, or if player fails to resolve to one or more online players.
On success, grants or removes the specified advancement(s) to the player(s).
Examples
To test yourself for the "iron leggings" criterion of the "Obtain armor" advancement: advancement test @p minecraft:story/obtain_armor iron_leggings
To grant the "Shiny gear" advancement to yourself: advancement grant @p only minecraft:story/shiny_gear


ban

以下のコマンドはサーバーのブラックリスト(BANリスト)を管理する。ブラックリストとは、サーバーへの接続ができないプレイヤーまたはIPアドレスの一覧である。BANはどんなホワイトリストよりも優先される。

/whitelist」も参照

ban

コマンド
必要権限レベル

不明

実行制限

なし

プレイヤーをブラックリストに追加する。

構文
ban <プレイヤー名> [理由 …]
引数
プレイヤー名
BANするプレイヤーの名前を入れる。オンラインである必要はなく、さらには実在する必要もない。
理由 (任意)
BANの通知と一緒に発信されるメッセージ。オペレーターが受信し、加えてサーバーのログに残る。
結果
常に成功する。指定したプレイヤー名がサーバーのブラックリストに追加され、追加された名前のプレイヤーがサーバーに接続することを防止する


ban-ip

コマンド
必要権限レベル

不明

実行制限

なし

IPアドレスをブラックリストに追加する。

構文
ban-ip <アドレス|プレイヤー名> [reason …]
引数
アドレス|プレイヤー名
IPアドレス、または今オンラインなプレイヤーの名前
理由 (任意)
BANの通知と一緒に発信されるメッセージ。オペレーターが受信し、加えてサーバーのログに残る。
結果
アドレス|プレイヤー名 の引数に、正しくないIPアドレスまたはオンラインではないプレイヤー名を入れると失敗する。
成功すると、IPアドレス (オンラインなプレイヤーのIPアドレス、または指定したアドレス) がサーバーのブラックリストに追加され、そのIPアドレスからサーバーに接続することを防止する


banlist

コマンド
必要権限レベル

不明

実行制限

なし

サーバーのブラックリストを表示する。

構文
banlist ips
banlist players
結果
常に成功する。BANされたIPアドレスの一覧、もしくはBANされたプレイヤー名一覧が表示される


blockdata

コマンド
必要権限レベル

不明

実行制限

なし

ブロックのデータタグを編集する。

構文
blockdata <x> <y> <z> <データタグ>
引数
x y z
編集するブロックの座標を指定する。 チルダ表記法を使って、コマンドが実行された位置からの相対座標で指定することもできる。
データタグ
編集するブロックの、追加される、または上書きされるデータタグを指定する。複合されたNBTタグである必要がある(例えば、{CustomName:Fred})。
結果
引数が正しく指定されなかった場合、または指定したブロックがブロックエンティティではないなど"データを含まないブロック"だった場合に失敗する。
成功すると、指定したブロックのデータタグが編集される。
座標(0,64,0)のビーコンの一つ目の効果を採掘速度上昇に変更する:
blockdata 0 64 0 {Primary:3}
参照
  • Chunk format#Block entity format ― タイルエンティティブロックの定義されたデータタグ一覧
  • /entitydata ― エンティティのデータタグを変更するコマンド
  • /replaceitem ― ブロックのインベントリのアイテムを置換するコマンド
  • /setblock ― ブロックを設置するコマンド
  • /stats ― ブロックのコマンド実行結果の処理を設定するコマンド


clear

コマンド
必要権限レベル

不明

実行制限

なし

プレイヤーのインベントリからアイテムを消去する。

構文
  • PC版
clear [プレイヤー] [アイテム] [データ] [最大個数] [データタグ]
  • Pocket Edition
clear [プレイヤー: target] [アイテム: string] [データ: int] [最大個数: int]
引数
プレイヤー (PE: プレイヤー: target) (任意)
プレイヤー名またはターゲットセレクターである必要がある。指定しなかった場合は、コマンドを実行したプレイヤーがターゲットとなる。コマンドブロックではこの引数は必須。
アイテム (PE: アイテム: string) (任意)
消去するアイテムのidを指定する。指定しなかった場合、インベントリの全てのアイテムが消去される。
データ (PE: データ: int) (任意)
消去するアイテムのデータの数値を指定する。指定しなかった場合、または-1を指定した場合、IDが合致するアイテムがそのデータに関わらず消去される。
最大個数 (PE: 最大個数: int) (任意)
アイテムを消去する最大の個数を指定する。指定しなかった場合、または-1を指定した場合、IDとデータが合致するアイテムが全て消去される。もし0ならアイテムは消去されないが、条件に合うアイテムが存在した場合はコマンドの実行に成功した扱いになる。(これはアイテムを消去せずにアイテムを検知することを可能にする)。
データタグ (任意) ‌[PC版 Edition限定]
消去するアイテムのデータタグを指定する(指定したデータタグに合致するアイテムのみ削除される ― 指定されなかったデータタグは考慮されない)。 複合されたNBTタグである必要がある(例えば、{display:{Name:Fred}})。
結果
引数が正しく指定されなかった時、プレイヤー引数でオンラインのプレイヤーを解決できなかった時、アイテムが消去されなかった時失敗する(最大個数0の場合を除く)
成功すると、プレイヤーから指定したアイテムが消去される。
自分のインベントリを全消去する: 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}]}
参照
/blockdata ― ブロックのインベントリのアイテムを変更または消去するコマンド
/entitydata ― エンティティのインベントリのアイテムを変更または消去するコマンド
/give ― プレイヤーにアイテムを与えるコマンド
/kill ― エンティティとしてのアイテムを消去するコマンド
/replaceitem ― ブロックやエンティティのインベントリのアイテムを置換するコマンド


clone

コマンド
必要権限レベル

不明

実行制限

なし

ブロックを1つの領域から他の領域へ複製する。

構文
clone <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [マスクモード] [クローンモード] [ブロック名]
読みやすくするために色分けしてある。ゲーム内のヘルプでは、最後の引数が示されない ― ブロック名は議論のための仮の名前である。
引数
x1 y1 z1x2 y2 z2
コピー元の領域の対立する角の座標を指定する。チルダ表記法を使ってコマンドを実行する位置からの相対座標で指定することもできる。
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.
x y z
コピー先の領域の、北西の低い位置の角の座標を指定する(すなわち各座標軸の数値が最小の場所)。チルダ表記法を使ってコマンドを実行する位置からの相対座標で指定することもできる。
マスクモード (任意)
複製するブロックをフィルタリングするか否かを指定する。以下のどれかを指定しなければならない:
  • filteredブロック名引数で指定したブロックのみ複製する。
  • masked ― 空気ではないブロックのみ複製する。さもないとコピー先のブロックがコピー元の空気によって上書きされてしまう。
  • replace ― 全てのブロックをコピーする。コピー元の領域のブロックによって、コピー先の領域のブロックは全て置き換えられる。
指定しなかった場合、デフォルトでreplaceになる。
クローンモード (任意)
コピー元の領域をどのように扱うかを指定する。以下のどれかを指定しなければならない:
  • force ― もしコピー元とコピー先の領域が重なっていたとしても複製を強制する。
  • move ― コピー先の領域へ複製した後、コピー元の領域が空気に置き換えられる。filteredモードを使う場合は、複製されたブロックのみ空気に置き換えられる。
  • normal ― 強制も移動もしない。
指定しなかった場合、デフォルトでnormalになる。
ブロック名 (任意)
マスクモードfilteredにした際の、コピーするブロックのIDを指定する(例えばminecraft:stone)。filteredモードを使う際は必須。
結果
引数が正しく指定されなかった場合、コピー元の領域のブロック数が32768ブロック(8チャンクを選択するための十分な数)を超えた場合、forceモードを使わずしてコピー元とコピー先の領域が重なった場合、コピー元とコピー先の領域のどちらかまたは両方が描画されていなかった場合失敗する。
成功すると、コピー先の領域のブロックがコピー元の領域のブロックで置き換えられ、moveモードを使わなかった場合はコピー元の領域はそのままになる。
参照
/fill ― 領域をブロックで満たす


debug

コマンド
必要権限レベル

不明

実行制限

なし

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 trying to start a debug session when one is already active, or if trying to stop a debug session when none is running.
On success, 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

コマンド
必要権限レベル

不明

実行制限

なし

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

構文
defaultgamemode <mode>
引数
mode
Specifies the default game mode for new players. Must be one of the following:
  • survival (can be abbreviated as s or 0) for survival mode
  • creative (can be abbreviated as c or 1) for creative mode
  • adventure (can be abbreviated as a or 2) for adventure mode
  • spectator (can be abbreviated as sp or 3) for spectator mode
結果
Fails if the arguments are not specified correctly.
If successful, sets the default game mode that is shown on the world selection menu. New players that join the world will be put into the default game mode.
To set the default game mode to survival: defaultgamemode survival, defaultgamemode s, or defaultgamemode 0
See also
/gamemode ― changes a player's game mode


deop

コマンド
必要権限レベル

不明

実行制限

なし

Revoke operator status from a player.

構文
deop <player>
引数
player
Specifies a player to remove from the list of operators. May be either a player name or a target selector, but target selectors will not evaluate; 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.
To remove Alice from the list of operators: deop Alice


difficulty

コマンド
必要権限レベル

不明

実行制限

なし

Sets the difficulty level (peaceful, easy, etc.).

構文
difficulty <difficulty>
引数
difficulty
Specifies the new difficulty level. Must be one of the following:
  • peaceful (can be abbreviated as p or 0) for peaceful difficulty
  • easy (can be abbreviated as e or 1) for easy difficulty
  • normal (can be abbreviated as n or 2) for normal difficulty
  • hard (can be abbreviated as h or 3) for hard difficulty
結果
Fails if the arguments are not specified correctly.
If successful, changes the game's difficulty. On a multiplayer server lasts only until the server is restarted ― on restart, difficulty is reloaded from server.properties.
To change the difficulty to hard: difficulty hard, difficulty h, or difficulty 3
See also
/gamemode ― changes a player's game mode (creative, survival, etc.)


effect

コマンド
必要権限レベル

不明

実行制限

なし

The effect command manages status effects on players and other entities.

構文
effect <player> clear (removes all effects)
effect <player> <effect> [seconds] [amplifier] [hideParticles] (gives an effect)
引数
player
Specifies the target(s). Must be a player name or a target selector (@e is permitted to target entities other than players).
effect
Specifies the effect to grant. Must be a status effect id (for example, 1 or minecraft:speed).
seconds (optional)
Specifies the effect's duration in seconds. Must be between 0 and 1,000,000 (inclusive). If not specified, defaults to 30 seconds.
amplifier (optional)
Specifies the number of additional levels to add to the effect. Must be between 0 and 255 (inclusive). If not specified, defaults to 0. Note that the first tier of a status effect (e.g. Regeneration I) is 0, so the second tier, for example Regeneration II, would be specified by an amplifier level of 1.
hideParticles (optional)
Specifies whether the particles of the status effect should be hidden. Must be either true or false. If not specified, defaults to false.
結果
Fails if arguments are not specified correctly, if player 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.
On success:
  • clear ― clears all status effects from the target(s).
  • effect ― Adds the status effect to the target(s). If a target already has the status effect, 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.
To grant a Speed 1 effect to the nearest player for 60 seconds: effect @p 1 60
To grant a Speed 3 effect to the nearest player for 60 seconds: effect @p minecraft:speed 60 2
To clear any Haste effects from all players: effect @a minecraft:haste 0
To clear all effects from all zombies: effect @e[type=Zombie] clear


enchant

コマンド
必要権限レベル

不明

実行制限

なし

Adds an enchantment to a player's selected item, subject to the same restrictions as an anvil.

構文
enchant <player> <enchantment ID> [level]
引数
player
Specifies the target(s). Must be a player name or target selector.
enchantment ID
Specifies the enchantment to be added to the item held by the target. Must be a valid enchantment ID (for example, 16 or minecraft:sharpness).
level (optional)
Specifies the enchantment level. Must be at least 1 and not greater than the maximum level for the specified enchantment. If not specified, defaults to 1.
結果
Fails if arguments are not specified correctly, if player 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").
On success, adds the specified enchantment to the item held by the target.
To give the Infinity enchantment to all players holding a bow: enchant @a 51
Note
Although /enchant enforces maximum levels and compatibility, other commands (such as /give, /replaceitem, and /entitydata) can bypass these restrictions.


entitydata

コマンド
必要権限レベル

不明

実行制限

なし

Modifies the data tag of an entity.

構文
entitydata <entity> <dataTag>
引数
entity
Specifies the entity(ies) to be modified. 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 (data tags cannot be removed and strings cannot be set to a null value). Must be a compound NBT tag (for example, {CustomName:Fred}).
結果
Fails if the arguments are not specified correctly, or if entity fails to resolve to one or more non-player entities (players can not be changed).
On success, modifies the data tag of the targeted entity(ies).
To prevent all current zombies from picking up loot:
entitydata @e[type=Zombie] {CanPickUpLoot:0}


execute

コマンド
必要権限レベル

不明

実行制限

なし

Executes a command on behalf of one or more other entities, with originating permissions, optionally on condition that a single-block /testforblock-style check passes.

構文
execute <entity> <x> <y> <z> <command …>
An alternate syntax allows the command to be executed only if a specific block is detected:
execute <entity> <x> <y> <z> detect <x2> <y2> <z2> <block> <data> <command …>

Color added to make reading easier.

引数
entity
Specifies the target to be the command's executor. Must be a player name or target selector. If more than one entity is selected, the command will be run once as each of them.
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). Coordinates specified with tilde notation are relative to the target, not to the position of the command's execution.
command
Specifies the command to be run. Must be a valid command.
x2 y2 z2 (detect mode only)
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).
block and data (detect mode only)
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.
結果
Fails if arguments are not specified correctly, if entity 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.
On success, executes the specified command as if executed by the specified target(s) with operator-level permission at the specified coordinate.
To summon lightning bolts at the positions of every zombie:
execute @e[type=Zombie] ~ ~ ~ summon LightningBolt
To summon lightning bolts at the positions of every zombie standing on any type of sand:
execute @e[type=Zombie] ~ ~ ~ detect ~ ~-1 ~ minecraft:sand -1 summon LightningBolt
To summon 10 creepers at the nearest player's position (only works as long as there are at least 10 entities in the loaded world):
execute @e[c=10] ~ ~ ~ execute @p ~ ~ ~ summon Creeper
See also
/testforblock ― tests for a certain block at a specified position (including specific data tags)


fill

コマンド
必要権限レベル

不明

実行制限

なし

指定したブロックで一部もしくは全てを埋める

構文
fill <x1> <y1> <z1> <x2> <y2> <z2> <TileName> [dataValue] [oldBlockHandling] [dataTag]
fillコマンドは replace を用いることで、別の構文が存在する。
fill <x1> <y1> <z1> <x2> <y2> <z2> <TileName> <dataValue> replace [replaceTileName] [replaceDataValue]
色マーカーは読みやすくするためのものである。
引数
x1 y1 z1x2 y2 z2
ブロックで埋めるための範囲(以下、選択範囲)を任意の2点(x1 y1 z1x2 y2 z2)を対角に取ることで指定する。チルダ表記法を使用することでコマンド実行の際に相対距離を指定できる。
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
選択範囲内を埋めるブロックを指定する。 ブロック ID (例:minecraft:stone)でなければならない。
dataValue (任意)
埋めるブロックに使用するブロックデータを指定する。0から15の値でなければならない(inclusive)。
oldBlockHandling (任意)
1つだけを選択:
  • destroy - 指定したブロックで選択範囲内の全てのブロック(空気ブロック含む)を破壊し、存在しているブロック (変更されていないものも含めて)と ブロックの中身のエンティティ(エンチャントされていないダイヤモンドシャベルやダイヤモンドピッケルで採掘されたような状態)がドロップする。ただし、つるのようにはさみで採掘されるブロックや液体はドロップしない。
  • hollow - 指定したブロックで選択範囲の枠部分のみを置き換える。 内側のブロックは空気ブロックに置き換えられ、それらの中身はそれ自身ではなくエンティティとしてドロップする。選択範囲が十分に小さい(内側が存在しない)場合、replaceと同じような結果になる。
  • keep - 指定したブロックで選択範囲内の空気ブロックの部分のみを置き換える。
  • outline - 指定したブロックで選択範囲の枠部分のみを置き換える。内側のブロックには影響を与えない。選択範囲が十分に小さい(内側が存在しない)場合、replaceと同じような結果になる。
  • replace - 指定したブロックで選択範囲内の全てのブロック(空気ブロック含む)を置き換え、ブロック等はドロップしない。必要に応じて、置き換えるために指定したデータタグの代わりに、ブロックIDとデータ値はどのブロックで置き換えるかを制限されうる(以下、replaceTileNamereplaceDataValue 参照)。
何も選ばなければ、デフォルトで replaceになる。
dataTag (任意)
埋めるブロックに使用するデータタグを指定する(例:チェストの内容、旗のパターン)。NBT tag (例:{CustomName:Fred})でなければならない。 replaceTileNamereplaceDataValue と組み合わせることは出来ない。
replaceTileName replaceDataValue (任意)
oldBlockHandlingreplaceの時のみ、この引数は有効である。dataTag と組み合わせることは出来ない。
選択範囲内のブロックを指定することで、その指定したブロックのみをTileNameで指定したブロックに置き換えることが出来る。
選択範囲内のブロックのデータ値を指定する。 もしreplaceDataValue が指定されていなければ、data valueはどのブロックでも無視される。 どちらの引数も指定していない場合、選択範囲内の全てのブロックが置き換えられる。
結果
Fails if the arguments are not specified correctly, 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.
On success, changes blocks in the fill region to the specified block.
/fill 52 63 -1516 33 73 -1536 minecraft:gold_block 0 replace minecraft:stained_hardened_clay 1
Replaces all the orange stained hardened clay in the selected area with gold blocks.
/fill ~-3 ~-3 ~-3 ~3 ~-1 ~3 minecraft:water 0
Replaces with water the blocks in a 7x7x3 cube directly beneath the player.
/fill ~-3 ~ ~-4 ~3 ~4 ~4 minecraft:planks 2 hollow
Creates a house-sized box around the player and replaces with air any blocks that would have been inside the box.


function

コマンド
必要権限レベル

不明

実行制限

なし

Runs a function.

Syntax
  • Computer
function <function> [if|unless] [selector]
Arguments
function
Must be of the format namespace:path/to/function/file.
if
Will only make the function run when an entity was found matching the selector.
unless
Will only make the function run when no entity was found matching the selector.
selector
When used with if or unless, this determines the entity to find or not find for the function to actually run.
Result
Fails if the argument is not specified correctly.
Fails if the selector was not found using if.
Fails if the selector was found using unless.
If successful, runs a function through the entity or commandblock which ran the /function command.
Examples
To run a function located at 'data/functions/custom/example/test.mcfunction': /function custom:example/test
To run a function if there is a sheep within a radius of 2 blocks: /function custom:example/test if @e[type=sheep,r=2]
To run a function unless the executor is a player: /function custom:example/test unless @s[type=player]
See also
gamerule gameLoopFunction – Runs a function every tick.


gamemode

コマンド
必要権限レベル

不明

実行制限

なし

プレイヤーのゲームモードを変更する

構文
gamemode <ゲームモード> [プレイヤー]
引数
ゲームモード
引数による分岐
  • survival (またはs0) でサバイバルモードにできる。
  • creative (またはc1) でクリエイティブモードにできる。
  • adventure (またはa2)でアドベンチャーモードにできる。
  • spectator (またはsp3)でスペクテイターモードにできる。
"hardcore" is not a valid option for the mode argument, as it is technically not a game mode.
player (optional)
If specified, must be either a player's username or a target selector. If unspecified, defaults to the player using the command. When used in a command block, player is not optional.
結果
Fails if the arguments are not specified correctly, or if player fails to resolve to one or more online players.
If successful, changes the game mode of the default or specified players.
To put yourself into creative mode: gamemode creative, gamemode c, or gamemode 1
To put all players into survival mode: gamemode 0 @a
See also
defaultgamemode ― sets the initial game mode for players joining the world


gamerule

コマンド
必要権限レベル

不明

実行制限

なし

Sets or queries a game rule value.

Syntax
  • Computer
gamerule <rule name> [value]
  • Pocket Edition
gamerule <rule: string> <value: bool>
gamerule <rule: string> <value: int>
gamerule [rule: string]
Arguments
rule name (PE: rule: string)
Specifies the game rule to set or query. May be any value, but only certain predefined game rules will affect gameplay (see Predefined Game Rules below).
value (PE: value: bool or value: int) (optional)
Specifies the value to set the game rule to. May be any value, though only true or false specified for predefined game rules will actually affect gameplay, except in the case of maxEntityCramming, randomTickSpeed and spawnRadius, where any integer 0 or greater will affect gameplay (see Predefined Game Rules below).
Predefined Game Rules
Rule Name Description Default Value Computer Pocket Edition
commandBlockOutput
(PE: commandblockoutput)
Whether command blocks should notify admins when they perform commands true はい はい
disableElytraMovementCheck Whether the server should skip checking player speed when the player is wearing elytra. Often helps with jittering due to lag in multiplayer, but may also be used to travel unfairly long distances in survival mode (cheating). false はい いいえ
doDaylightCycle
(PE: dodaylightcycle)
Whether the day-night cycle and moon phases progress true はい はい
doEntityDrops
(PE: doentitydrops)
Whether entities that are not mobs should have drops true はい はい
doFireTick
(PE: dofiretick)
Whether fire should spread and naturally extinguish true はい はい
doLimitedCrafting Whether players should only be able to craft recipes that they've unlocked first false はい いいえ
doMobLoot
(PE: domobloot)
Whether mobs should drop items true はい はい
doMobSpawning
(PE: domobspawning)
Whether mobs should naturally spawn. Does not affect monster spawners. true はい はい
doTileDrops
(PE: dotiledrops)
Whether blocks should have drops true はい はい
doWeatherCycle
(PE: doweathercycle)
Whether the weather will change true はい はい
drowningdamage Whether the player should take damage when drowning true いいえ はい
falldamage Whether the player should take fall damage true いいえ はい
firedamage Whether the player should take fire damage true いいえ はい
keepInventory
(PE: keepinventory)
Whether the player should keep items in their inventory after death false はい はい
logAdminCommands Whether to log admin commands to server log true はい いいえ
maxCommandChainLength Determines the number at which the chain command block acts as a "chain". 65536 はい いいえ
maxEntityCramming The maximum number of other pushable entities a mob or player can push, before taking 3♥♥ suffocation damage per half-second. Setting to 0 disables the rule. Damage affects survival-mode or adventure-mode players, and all mobs but bats. Pushable entities include non-spectator-mode players, any mob except bats, as well as boats and minecarts. 24 はい いいえ
mobGriefing
(PE: mobgriefing)
Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep, and villagers should be able to change blocks and whether villagers, zombies, skeletons, and zombie pigmen can pick up items true はい はい
naturalRegeneration Whether the player can regenerate health naturally if their hunger is full enough (doesn't affect external healing, such as golden apples, the Regeneration effect, etc.) true はい いいえ
pvp Whether the player can fight with other player 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 information; and whether the effects of F3 + B (entity hitboxes) and F3 + G (chunk boundaries) are shown. false はい いいえ
sendCommandFeedback
(PE: 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 Whether a message appears in chat when a player or a tamed pet (wolf, cat, or parrot) dies. true はい いいえ
spawnRadius The number of blocks outward from the world spawn coordinates that a player will spawn in when first joining a server or when dying without a spawnpoint. 10 はい いいえ
spectatorsGenerateChunks Whether players in spectator mode can generate chunks true はい いいえ
Result
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).
New game rules may be defined and set (by providing a value) or queried (by not providing a value).
Examples
To stop the day-night cycle: gamerule doDaylightCycle false
To stop natural healing: gamerule naturalRegeneration false
To define a new game rule called myNewRule and sets its value to 10: gamerule myNewRule 10


op

コマンド
必要権限レベル

不明

実行制限

なし

Grants operator status to a player.

構文
op <player>
結果
Always succeeds. Grants player operator status on the server.
New game rules may be defined and set (by providing a value) or queried (by not providing a value).
To stop the day-night cycle: gamerule doDaylightCycle false
To stop natural healing: gamerule naturalRegeneration false
To define a new game rule called MyNewRule and sets its value to 10: gamerule MyNewRule 10


give

コマンド
必要権限レベル

不明

実行制限

なし

Gives an item to a player.

構文
give <player> <item> [amount] [data] [dataTag]
引数
player
Specifies the target to give item(s) to. Must be a player name or target selector.
item
Specifies the item to give. Must be a valid item id (for example, minecraft:iron_shovel), or block id for which items exist. Numerical ids are unsupported.
amount (optional)
Specifies the number of items to give. Must be between 1 and 64 (inclusive), but can be 64 even when that's more than one stack. If not specified, defaults to 1.
data (optional)
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 revert 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}}).
結果
Fails if the arguments are not specified correctly, or if player fails to resolve to one or more online players.
On success, summons the specified item(s) at the location(s) of the target(s). If player resolves to multiple targets, each receives the specified number of items. The item entity's Owner tag is set to the target and its PickupDelay tag set to 0[要検証] so that it immediately enters the target's inventory if there is room.
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"]}}
To give Block of Diamond that can be placed on dirt and can break quartz block that can be done in adventure mode.
give John minecraft:diamond_block 1 0 {CanPlaceOn:["minecraft:dirt"],CanDestroy:["minecraft:quartz_block"]}
See also
/summon ― summon any entity at any location


help

コマンド
必要権限レベル

不明

実行制限

なし

Provides help/list of commands.

構文
help [page|command name]
? [page|command name]
引数
page|command name (optional)
Specifies the page number of the command list or the command to provide help for. If not specified, defaults to 1 (the first page of the command list).
結果
Fails if page is not a valid page number, or if command name is not a valid command name. Technically fails even if a valid command name is specified, although it displays the usage of the command.
On success, displays a page of the command list. Multiplayer commands will not be displayed while in singleplayer, even when open to LAN players.
If a valid command name was specified, displays the usage for that command. 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 (defaults to Tab ↹ key) to explore available options for each argument.
If the command is run via command block, it gives various messages prefixed with "Searge says: " as the previous output when activated: "Yolo", "/achievement take achievement.understandCommands @p", "Ask for help on twitter", "/deop @p", "Scoreboard deleted, commands blocked", "Contact helpdesk for help", "/testfornoob @p", "/trigger warning", "Oh my god, it's full of stats", "/kill @p[name=!Searge]", "Have you tried turning it off and on again?", "Sorry, no help today".
To display the first page of the command list: ? or help
To display the third page of the command list: ? 3
To display the usage for the help command: help help


kick

コマンド
必要権限レベル

不明

実行制限

なし

Kicks a player off a server.

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


kill

コマンド
必要権限レベル

不明

実行制限

なし

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

構文
kill [player|entity]
引数
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.
結果
Fails if player|entity fails to resolve to one or more entities (named players must be online).
On success, inflicts 3.4 x 1038 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.
To kill yourself: kill
To kill a player named Bob: kill Bob
To "kill" all item entities (making them vanish from the world): kill @e[type=Item]
To "kill" all entities within loaded chunks, including yourself: kill @e


list

コマンド
必要権限レベル

不明

実行制限

なし

Lists players on the server.

構文
list [uuids]
Description
Shows the names of all currently-connected players (the same can be achieved when pressing tab).
If 'uuids' is specified, player UUIDs will be shown alongside names.
Success Conditions
Always succeeds, even in a command block.


locate

コマンド
必要権限レベル

不明

実行制限

なし

Displays the coordinates for the closest structure of a given type in the chat for the player who executed the command.

Syntax
locate <StructureType>
locate stronghold[Pocket Edition限定]
Arguments
StructureType
Specifies the structure to locate. Must be one of the following:

The structure type is case-sensitive.

Result
Fails if the arguments are not specified correctly, or if unable to locate the requested StructureType (for example, if it's in a different dimension).
If successful, displays the coordinates for the closest structure of the given type in the chat, for the player who executed the command. Will display the Y coordinate as (y?) for some structures.
Examples
To obtain the coordinates of the nearest woodland mansion: locate Mansion
Note
In Pocket Edition, only strongholds can be found with this command.‌[1.0で追加予定]


me

コマンド
必要権限レベル

不明

実行制限

なし

Displays a message about yourself.

構文
me <action ...>
結果
Fails if any target selectors do not resolve to at least one online player, or if any named players are not online.
On success, sends a narrative message to the other players in the form of "* Your Name 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 and name2" for two players, or "name1, name2, ... and nameN" for N players.


pardon

コマンド
必要権限レベル

不明

実行制限

なし

Removes entries from the banlist.

構文
pardon <name>
pardon-ip <address>
引数
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.
結果
Fails if the arguments are not specified correctly.
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

コマンド
必要権限レベル

不明

実行制限

なし

Creates particles.

構文
particle <name> <x> <y> <z> <xd> <yd> <zd> <speed> [count] [mode] [player] [params ...]
Color added to make reading easier.
引数
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 3-dimensional cuboid volume to spawn particles in, centered on position x y z, and divided by about 8 (using 1 1 1 specifies a cuboid of about 8×8×8 in size).
Exception: When name is reddust, mobSpell, or mobSpellAmbient and speed is not 0, and count is 0 or not specified, these values are set as the RGB channel values of the color of the particle, and are specified in the range 0 to 1. In this usage, the speed parameter acts as a multiplier on these values. If count is greater than 0 for those particles, xd yd zd are treated as a 3-dimensional volume as usual, rather than as a color, and randomized colors are used.
With mobSpell or mobSpellAmbient, 0 0 0 produces a black particle for example, 0 1 0 produces a green particle, and 0 0 0.5 produces a dark blue particle, etc.
The reddust particle's red channel behaves differently: it has a default value of 1, so that setting xd to 0 will instead set the red channel to 1, though setting it to any other value behaves as usual. The reddust xd yd zd parameters can also use values outside the range 0 to 1, though this can have unexpected results.
Even after all this, reddust will apply a randomization to that color: each channel's value is multiplied by a separate random value from 0.8 to 1.0, then they all are multiplied by a single random value from 0.6 to 1.0.
Examples for reddust red channel special behavior:
given value effective value color
0 0 0, or 1 0 0 1 0 0 red
0 1 0, or 1 1 0 1 1 0 yellow
0 0.5 0, or 1 0.5 0 1 0.5 0 orange
0 0 1, or 1 0 1 1 0 1 purple
0 1 1, or 1 1 1 1 1 1 white
0.001 0 0 0.001 0 0 black
0.001 1 0 0.001 0 0 green
0.001 0 1 0.001 0 0 blue
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 up to 256 blocks away and by players that use the minimal particles setting.
player (optional)
Allows control of which player should view this particle instead of everyone in the viewing range of the particle.
params (optional)
Allows blockdust, iconcrack, blockcrack and fallingdust to be modified to view a specific item or block. Two parameters are accepted for iconcrack.
For blockdust, blockcrack and fallingdust, the params argument specifies a numeric id (block only) and a data value, using a single number: id+(data×4096).
For iconcrack, two params arguments specify the numeric id (block id or item id) and the data value separately.
結果
Fails if the arguments are not specified correctly.
On success, creates the specified particle.
To create a stationary huge explosion particle 10 blocks to the east:
particle hugeexplosion ~10 ~ ~ 0 0 0 0


playsound

コマンド
必要権限レベル

不明

実行制限

なし

Plays a sound.

構文
playsound <sound> <source> <player> [x] [y] [z] [volume] [pitch] [minimumVolume]
引数
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).
source
Specifies which category in the music & sound options the sound falls under. Must be master, music, record, weather, block, hostile, neutral, player, ambient, or voice.
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).
結果
Fails if the arguments are not specified correctly, 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

コマンド
必要権限レベル

不明

実行制限

なし

Opens single-player world to the local network.

構文
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.
Cannot be used on a multiplayer server, and will fail if the world is already published to LAN.


recipe

コマンド
必要権限レベル

不明

実行制限

なし

Gives or takes (unlocks or locks) recipes for players.

Syntax
recipe <give|take> [player] <name|*>
Arguments
give|take
If give, the recipe will be given (unlocked) for the player. If take, the recipe will be taken (locked) for the player.
player
Specifies the player to give or take the recipe from. May be a player name or a target selector.
name
The item ID of the recipe to give or take. If you specify *, it will give or take all recipes from that player.
Result
Fails if the arguments are not specified correctly, if player fails to resolve to one or more online players, or if no new recipes are given or taken.
On success, returns the number of recipes given or taken.


replaceitem

コマンド
必要権限レベル

不明

実行制限

なし

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

構文
replaceitem block <x> <y> <z> <slot> <item> [amount] [data] [dataTag]
replaceitem entity <selector> <slot> <item> [amount] [data] [dataTag]
引数
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 one or more entities 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.mainhand works on players, armor stands and mobs (though not all mobs will show or make use of the items).
slot.weapon.offhand
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}}).
結果
Fails if the arguments are not specified correctly, 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 none of the targeted entities 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) wherever possible.
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

コマンド
必要権限レベル

不明

実行制限

なし

These commands manage server saves.


save-all

Saves the server to disk.

構文
save-all [flush]
Description
Causes the server to mark all chunks and player data as needing to be saved. They will be saved over time (about 24 every 45 seconds) until all are flushed to disk.
If 'flush' is specified as the sole argument to the command, all the chunks will be saved to disk immediately, freezing the server for a short time.
Success Conditions
Succeeds if the map is successfully saved to disk. If an error occurs (such as the disk being full, or another copy of Minecraft has the map open) the command will fail.


save-off

Disables automatic server saves.

構文
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.

構文
save-on
Description
Enables the server writing to the world files. This is the default behavior.
結果
Always succeeds.


say

コマンド
必要権限レベル

不明

実行制限

なし

Sends a message in the chat to other players

構文
say <message …>
結果
Fails if any target selectors do not resolve to at least one online player, or if any named players are not online.
On success, broadcasts message to all players on the server. If a multi-person target selector (e.g., @a) is used in message, the list of names is formatted as "name1 and name2" for two players, or "name1, name2, ... and nameN" for N players.


scoreboard

コマンド
必要権限レベル

不明

実行制限

なし

These commands manage scoreboard objectives, players, and teams.

構文
scoreboard <objectives|players|teams> …

See Scoreboard#Command reference for more information.


seed

コマンド
必要権限レベル

不明

実行制限

なし

Displays the world seed.

構文
seed
結果
Always succeeds. This command can always be used in single-player mode, regardless of whether cheats are enabled or not.


setblock

コマンド
必要権限レベル

不明

実行制限

なし

Changes a block to another block.

構文
setblock <x> <y> <z> <TileName> [dataValue] [oldBlockHandling] [dataTag]
引数
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 or 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}).
結果
Fails if the arguments are not specified correctly, if tried to change a non-air block in keep mode, tried to replace a block with an identical copy in keep or replace mode, or if the coordinates are in an unloaded chunk.
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

コマンド
必要権限レベル

不明

実行制限

なし

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

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


setmaxplayers

コマンド
必要権限レベル

不明

実行制限

なし

Sets the maximum number of players allowed to join a multiplayer game.

Syntax
setmaxplayers <maxPlayers: int>
Arguments
maxplayers
Specifies the desired new maximum number of players. If less than the current number of players or greater than the maximum number of connections the server can accept, the argument is forced into this range.
Result
Fails if maxPlayers is omitted or isn't an integer.
On success, displays the new maximum number of players in the chat. An additional notification message is displayed if the number specified in the command was forced into the allowed range.
Note: This command can be entered in single-player mode, but has no effect until you reopen the world in multiplayer mode.


setworldspawn

コマンド
必要権限レベル

不明

実行制限

なし

Sets the world spawn.

構文
setworldspawn
setworldspawn <x> <y> <z>
引数
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 underground 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.
結果
Fails if the arguments are not specified correctly.
On success, sets the world spawn to the specified coordinate.


spawnpoint

コマンド
必要権限レベル

不明

実行制限

なし

Sets the spawn point for a player.

構文
spawnpoint
spawnpoint <player>
spawnpoint <player> <x> <y> <z>
引数
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).
結果
Fails if the 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

コマンド
必要権限レベル

不明

実行制限

なし

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

構文
spreadplayers <x> <z> <spreadDistance> <maxRange> <respectTeams> <player …>
引数
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).
結果
Fails if the arguments are not specified correctly, 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.
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

コマンド
必要権限レベル

不明

実行制限

なし

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」も参照
構文
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>
引数
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.
結果
Fails if the arguments are not specified correctly, 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.
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

コマンド
必要権限レベル

不明

実行制限

なし

Stops a server.

構文
stop
結果
Always succeeds. Saves all changes to disk, then shuts down the server.


stopsound

コマンド
必要権限レベル

不明

実行制限

なし

Stops a sound.

構文
stopsound <player> [source] [sound]
引数
player
Specifies the sound's target. Must be a player name or a target selector.
source (optional)
Specifies which category in the music & sound options the sound falls under. Must be master, music, record, weather, block, hostile, neutral, player, ambient, or voice.
sound (optional)
Specifies the sound to stop. Must be a sound event defined in sounds.json (for example, mob.pig.say).
結果


summon

コマンド
必要権限レベル

不明

実行制限

なし

Summons an entity (mobs, projectiles, items, vehicles, etc.).

構文
summon <EntityName> [x] [y] [z] [dataTag]
引数
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.
結果
Fails if the arguments are not specified correctly.
On success, creates the specified entity at the specified position.
To summon a charged creeper named "Powered Creeper" at the current position:
summon Creeper ~ ~ ~ {powered:1,CustomName:Powered Creeper}
To summon lightning 10 blocks west of the current position:
summon LightningBolt ~-10 ~ ~
To summon an Armor stand wielding a lava bucket and wearing a skeleton skull:
summon ArmorStand ~ ~ ~ {ArmorItems:[{},{},{},{id:skull}],HandItems:[{id:lava_bucket},{}]}


teleport

コマンド
必要権限レベル

不明

実行制限

なし

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

Syntax
teleport <target entity> <x> <y> <z> [<y-rot> <x-rot>]
Arguments
target entity
Specifies the entity(s) to be teleported. Must be either a player name or a target selector.
x y z
Specifies the coordinates to teleport the target(s) to. x and z must fall within the range -30,000,000 to 30,000,000 (exclusive, without the commas), and y must be within the range -4096 to 4096 inclusive. May use tilde notation to specify a position relative to the position of the executor of the command. /tp or /execute can be used to teleport using coordinates relative to the target.
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 due 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 fails to resolve to a single entity (a named player must be online). Fails individually for each entity referenced by target player that is not in the same dimension as the destination player, if specified.[要検証]
On success, teleports the targets to the specified destination.
Examples
To teleport all cows to yourself: teleport @e[type=Cow] ~ ~ ~
To teleport yourself to x=100 and z=100, but three blocks above your current position: teleport @p 100 ~3 100
To rotate yourself 10 degrees to the right without changing your position: teleport @p ~ ~ ~ ~10 ~


tell

コマンド
必要権限レベル

不明

実行制限

なし

Sends a private message to one or more players.

構文
tell <player> <message …>
msg <player> <message ...>
w <player> <message ...>
引数
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).
結果
Fails if the arguments are not specified correctly, 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. If a multi-person target selector (e.g., @a) is used in message, the list of names is formatted as "name1 and name2" for two players, or "name1, name2, ... and nameN" for N players.
To privately tell Alice to start the mission: tell Alice Start the mission!


tellraw

コマンド
必要権限レベル

不明

実行制限

なし

Sends a JSON message to players.

構文
tellraw <player> <raw json message>
引数
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}).
結果
Fails if the arguments are not specified correctly, 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

コマンド
必要権限レベル

不明

実行制限

なし

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

構文
testfor <player> [dataTag]
引数
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}).
結果
Fails if the arguments are not specified correctly, 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.
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 zombies within a 20-block radius of (0,64,0): testfor @e[0,64,0,20,type=Zombie]
To count the number of players currently flying: testfor @a {abilities:{flying:1b}}
To test if a arrow is in a block testfor @e[type=Arrow] {inGround:1b}


testforblock

コマンド
必要権限レベル

不明

実行制限

なし

Tests whether a certain block is in a specific location.

構文
testforblock <x> <y> <z> <TileName> [dataValue] [dataTag]
引数
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.
結果
Fails if the arguments are not specified correctly, 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.
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

コマンド
必要権限レベル

不明

実行制限

なし

Tests whether the blocks in two regions match.

構文
testforblocks <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [mode]
Color added to make reading easier.
引数
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 255 (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.
結果
Fails if the arguments are not specified correctly, 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

コマンド
必要権限レベル

不明

実行制限

なし

Changes or queries the world's game time.

構文
time <add|query|set> <value>
引数
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, gametime or day.
  • set - Must be between 0 and 2,147,483,647 (inclusive, without the commas), day, or night.
結果
Fails if the arguments are not specified correctly.
On success:
  • add - adds value to the world's game time
  • query daytime - returns the number of game ticks since dawn.
  • query gametime - returns the age of the world in game ticks.
  • query day - returns the number of in-game days passed (matching the debug screen).
  • set - sets the world game time to value (day = 1,000, night = 13,000).
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

コマンド
必要権限レベル

不明

実行制限

なし

Controls 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 are specified using 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).

構文
The command has five variations, each with different arguments.
title <player> clear (removes the screen title from the screen)
title <player> reset (resets options to default values)
title <player> subtitle <title> (specifies the subtitle text)
title <player> times <fadeIn> <stay> <fadeOut> (specifies fade-in, stay, and fade-out times)
title <player> title <title> displays the screen title)
引数
player
Specifies the player(s) to display a screen title to. Must be a player name or target selector.
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), defaults to 20 (1 second), 60 (3 seconds), and 20 (1 second).
結果
Title command

Example result of the title command.

Fails if the arguments are not specified correctly, 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, and the fade-in, stay and fade-out times to their default values for the specified player(s).
  • subtitle ― If a screen title is currently being displayed to the specified player(s), changes the current subtitle to title; otherwise, specifies the subtitle for the next screen title to be displayed to the specified player(s).
  • times ― Changes the fade-in, stay, and fade-out times of all current and future screen titles for the specified player(s).
  • title ― Displays a screen title to the specified player(s), or changes the current screen title to title. After fading out, resets the subtitle back to blank text, but does not reset fade-in, stay, and fade-out times.
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

コマンド
必要権限レベル

不明

実行制限

なし

Toggles the weather.

構文
toggledownfall
結果
Always succeeds. If weather is currently clear, rain or snow will start. If weather is currently rain, snow, or a thunderstorm, it will become clear. Can be overridden by the /weather command.


tp

コマンド
必要権限レベル

不明

実行制限

なし

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

構文
tp [target player] <destination player>
tp [target player] <x> <y> <z> [<y-rot> <x-rot>]
引数
target player (optional)
Specifies the entity(s) to be teleported. Must be either a player name or a target selector. If not specified, defaults to the player who executed the command. Not optional in command blocks.
destination player
Specifies the entity to teleport the target(s) to. Must be either a player name or a target selector.
x y z
Specifies the coordinates to teleport the target(s) to. x and z must fall within the range -30,000,000 to 30,000,000 (exclusive, without the commas), and y must be within the range -512 to 512 (inclusive). 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 due 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.
結果
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 fails to resolve to a single entity (a named player must be online). Fails individually for each entity referenced by target player that is not in the same dimension as the destination player, if specified.
On success, teleports the targets to the specified destination.
To teleport yourself to Alice: tp Alice
To teleport all players to yourself: tp @a @p
To teleport yourself to x=100 and z=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

コマンド
必要権限レベル

不明

実行制限

なし

Modifies a scoreboard objective with a "trigger" criteria.

構文
trigger <objective> <add|set> <value>
Description
Used together with /tellraw to let players activate systems made by operators or mapmakers.
引数
objective
An enabled scoreboard objective with the "trigger" criteria.
add|set
  • add ― Adds value to the current value of objective.
  • set ― Sets the value of objective to value.
結果
Fails if the arguments are not specified correctly, if objective does not have the "trigger" criteria, or if the player who executed the command is not able to modify objective.
On success, the value of objective is changed for the player that executed the command.


weather

コマンド
必要権限レベル

不明

実行制限

なし

Sets the weather.

構文
weather <clear|rain|thunder> [duration]
引数
clear|rain|thunder
  • clear ― Set the weather to clear.
  • rain ― Set the weather to rain (or snow in cold biomes).
  • thunder ― Set the weather to a thunderstorm (or a thunder snowstorm in cold biomes).
duration (optional)
Specifies the time in seconds for the specified weather to last. Must be between 1 and 1,000,000 (inclusive, without the commas). If duration is omitted, the duration will be set between 6,000 and 18,000 ticks.
結果
Fails if the arguments are not specified correctly.
On success, changes the weather for the specified duration (in seconds).
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


whitelist

コマンド
必要権限レベル

不明

実行制限

なし

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.

構文
The command has six variations.
whitelist add <player>
whitelist list
whitelist off
whitelist on
whitelist reload
whitelist remove <player>
引数
player (add and remove mode only)
Specifies the player(s) to add or remove from the whitelist.
結果
Fails if the arguments are not specified correctly, or 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

コマンド
必要権限レベル

不明

実行制限

なし

These commands control the world border.

構文
The command has eight variations, each with different arguments:
worldborder add <distance> [time] (increases the world border diameter)
worldborder center <x> <z> (recenters the world boundary)
worldborder damage amount <damagePerBlock> (specifies the world border damage rate)
worldborder damage buffer <distance> (specifies the world border damage buffer distance)
worldborder get (returns the world border diameter)
worldborder set <distance> [time] (sets the world border diameter)
worldborder warning distance <distance> (specifies the world border warning distance)
worldborder warning time <time> (specifies the world border warning time)
引数
distance (add, damage buffer, set and warning distance 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 a player must be before they 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).
  • warning distance ― 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.
time (add, set and warning time modes only)
Specifies a time in seconds:
  • add ― 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.
  • set ― 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.
  • warning time ― Specifies the number of seconds that a player will begin to see a visual warning before a moving world border passes their position. Must be at least 0. Initially set to 15.
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.
結果
Fails if the arguments are not specified correctly, or if the 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 by the specified amount. If distance is positive, the world border will turn green and start increasing; if negative, the world border will turn red and start decreasing. If time is 0 or unspecified, the change occurs immediately; otherwise the change proceeds at a rate of (distance/2)/time blocks per second.
  • center ― The center of the world border immediately 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 to the specified value. If distance 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 time is 0 or unspecified, the change occurs immediately; otherwise the change proceeds at a rate of ((distance-<current diameter>)/2)/time blocks per second.
  • warning distance ― Sets the world border warning distance to the specified value.
  • warning time ― Sets the world border warning time to the specified value.


xp

コマンド
必要権限レベル

不明

実行制限

なし

Adds experience to a player.

構文
xp <amount> [player]
xp <amount>L [player]
引数
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. If not specified, defaults to the command's executor. Not optional in command blocks.
結果
Fails if arguments are not specified correctly, 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.
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]
me <アクション文字列> /emote/action のように、IRCクライアントの /me コマンドと同じもので、他のプレイヤーに物語のメッセージを「* あなたの名前 アクション文字列」の形で送る(例: 「* Notch sneezes.」や「* Notch exploded.」など)[要検証]。もし複数プレイヤーを示す目標選択子(つまり @a)が アクション文字列 で用いられると、名前の一覧が2人の場合は「名前1 and 名前2」、3人の場合「名前1, 名前2, and 名前3」のようになる。ゆえに アクション文字列 にどのような選択子が用いられようと、このコマンドの出力は1回のみになる。 アクション文字列 内の 全ての 目標選択子 (つまり @p) が評価される必要がある。
help [ページ番号 | コマンド名] コマンドの一覧を表示するか、コマンド名の詳細を表示する。備考: マルチプレイ専用とされるコマンドはシングルプレイゲームでは表示されない。たとえLANに向け公開(LAN内マルチプレイ)されていたとしても、である。 ページ番号 に正当な値が指定されるか、ページ番号やコマンド名が指定されていない場合に成功となる。コマンド名 が指定されたときは返値は「失敗」となるが、当該コマンドの使用法は表示される。
? [ページ番号 | コマンド名]
tell <プレイヤー名> <メッセージ> サーバー上にいる指定したプレイヤーにプライベートメッセージを送信する。PvP(プレイヤー対戦)サーバーでは他のプレイヤーには秘密にしつつ何かを頼みたいときに便利である。もし複数プレイヤーを示す目標選択子(つまり @a)が メッセージ で用いられると、名前の一覧が2人の場合は「名前1 and 名前2」、3人の場合「名前1, 名前2, and 名前3」のようになる。ゆえに メッセージ にどのような選択子が用いられようと、このコマンドの出力は1回のみになる。しかし プレイヤー名 に選択子が用いられると複数のプレイヤーへとメッセージを送信できる。 メッセージ 内の 全ての 目標選択子(つまり @p)が評価され、かつ プレイヤー名 のプレイヤーがオンラインである場合。
  1. コマンドの「成功条件」とは、コマンドの実行が「成功した」と看做される為に必要なものである。様々なものの決定、例えばコマンドブロックからコンパレーターで信号を引き出したものなどに用いられる。全てのコマンドの「成功」が何かを実行する、あるいは全てのコマンドの「失敗」が目的が達成できなかったことを意味するわけではないので注意してほしい。

オペレーター限定コマンド

マルチプレイで、op(英:Operator; オペレーター)がサーバーのコンソールだけでなく、チャットウィンドウで用いることが出来るものである。チャットウィンドウではスラッシュ記号をコマンド名の前に付ける。シングルプレイでは、チートが有効になったワールドか、自身がホスト(公開)しているワールドで使用可能である。

注意: Opコマンドは他のオンライン上のオペレーターにも通知される。

コマンド 説明 成功条件
clear <プレイヤー名> [アイテム] [メタデータ] プレイヤー名 の持ち物全てか、アイテム:メタデータ で指定されたアイテムを削除する。 プレイヤー名 のプレイヤーがオンラインで、かつ1つ以上のアイテムの削除が行われた場合。
debug <start | stop> 新しいデバッグプロファイリングのセッションを開始するか、今実行中のセッションを停止する。コンソールにパフォーマンスへの影響がある旨の注意書きが表示され、停止すると debug フォルダーにプロファイラーの結果ファイルが作成される。 セッションが実行中で無ければ停止できない。コマンドブロックでは使用不可。
defaultgamemode <survival | creative | adventure> ワールド選択時のデフォルトのゲームモードを指定する。ワールドに参加しようとする新たなプレイヤーはそのゲームモードでの参加となる。ゲームモード名の短縮形として「s/c/a」の一文字か、「0/1/2」の番号がそれぞれ指定可能である。このコマンドはハードコアモードでは機能しない。 ゲームモードが正しい値である場合。
difficulty <peaceful | easy | normal | hard> 難易度を変更する。難易度は順に、p/e/n/h、0/1/2/3 という形で簡略表記できる。 難易度として正しい値である場合。
effect <プレイヤー名> <効果> [秒数] [増幅度] 指定されたプレイヤーに指定されたステータス効果を指定された秒数(デフォルトでは30秒)、与える。効果時間は1,000,000秒までに制限され、増幅度 は最大255までとなる。効果のID番号はステータス効果のページを参照。秒数 に0を指定することでその効果を削除する。If you put the amplifier to a number of a variably high value, it will not give the desired amplifier 効果を削除する場合、その効果を既に受けている必要がある。効果 が正しい値で、プレイヤー名 のプレイヤーがオンラインである場合。
enchant <プレイヤー名> <エンチャントID> [エンチャントレベル] そのプレイヤーが手にしているアイテムにIDで指定される番号のエンチャントを付与する。アイテムのエンチャのとの通常の制限内でのみ機能することに注意。指定されたエンチャントを通常付与可能なアイテムにのみ、このコマンドでもエンチャントを与えられる。レベルも選択されたエンチャントの通常存在する最大のレベル以上のものを与えることはできない。通常拒否されるような、重複、または強化させすぎな組み合わせは、このコマンドでも拒否される。 エンチャントID が正当な値で、レベルが正しい範囲内の値で、持っているアイテムがこのエンチャントを受け入れ可能であり、相容れないエンチャントが持っているアイテムに既に存在しておらず、プレイヤー名 で指定されるプレイヤーがオンラインの場合。
gamemode <survival | creative | adventure> [プレイヤー名] プレイヤー名のゲームモードを変更する。ゲームモード名の短縮形として「s/c/a」の一文字か、「0/1/2」の番号がそれぞれ指定可能である。プレイヤー名が省略されると自身のゲームモードを変更する。特定のプレイヤーのみを変更し、その他のプレイヤーは変えないので忘れないように。 ゲームモード名が正しく、プレイヤー名 のプレイヤーがオンラインの場合。コマンドブロックでは プレイヤー名 は必須なので注意が要る。
gamerule <ルール名> [true | false] ルール名で指定されるものを切り替える。trueなら有効、falseなら無効。true/falseの指定が無い場合は現在の状態を表示する。ルール名に指定可能なものは次の通り。
  • commandBlockOutput - コマンドブロックがコマンドを実行した際に管理者に通知するか否か[要検証]
  • doFireTick - 延焼するか否か。
  • doMobLoot - Mobがアイテムをドロップするか否か。
  • doMobSpawning - Mobが自然発生(スポーン)するか否か。
  • doTileDrops - ブロックからのドロップがあるか否か。
  • keepInventory - プレイヤーの死亡時に持ち物を維持するか否か。
  • mobGriefing - クリーパー、エンダーマン、ガスト、ウィザーによるブロックの変更を可能にするか否か。またゾンビ、スケルトン、ゾンビピッグマンがアイテムを拾うことが出来るようになるか否か。
  • naturalRegeneration - 満腹度が一定の水準以上にある場合にプレイヤーの体力が自然回復するか否か。
  • doDaylightCycle - 昼夜サイクルの推移が行われるか否か。
常に成功する。ルール名 に未知の文字列を指定しようと、true/false 以外の状態を指定しても、である。
give <プレイヤー名> <アイテム> [] [メタデータ] アイテムメタデータ で指定されるアイテムを、 (省略時は 1)個、プレイヤー名 の場所に出現させる。例えば /give John 5 30 1 とすることで、プレイヤー名が「John」へと30個の松の木材を与える。 アイテム が正当なIDであり、 が1から64の範囲内で、かつ プレイヤー名 のプレイヤーがオンラインの場合。
kill ユーザーに無限のダメージを与え、殺す。迷ったり、閉じ込められたりした際、あるいは体力や満腹度の回復として有用である(アイテムを取り戻しやすいと仮定して)。同時に次のメッセージが表示される: "Ouch. That looked like it hurt."[要検証] コマンドブロックでは使用不可。
publish シングルプレイ限定。今プレイしているシングルプレイのワールドをLAN内に公開し、他のプレイヤーが参加できるようにする。 コマンドブロックでは使用不可。
say <メッセージ> メッセージ を、サーバー上の全てのプレイヤーに一斉送信する。もし複数プレイヤーを示す目標選択子(つまり @a)が メッセージ で用いられると、名前の一覧が2人の場合は「名前1 and 名前2」、3人の場合「名前1, 名前2, and 名前3」のようになる。ゆえに メッセージ列 にどのような選択子が用いられようと、このコマンドの出力は1回のみになる。 メッセージ 内の 全ての 目標選択子(つまり @p)が評価される必要がある。
scoreboard <objectives|players|teams> 詳細についてはスコアボードを参照。スコアボード限定コマンド一覧。 スコアボード限定コマンドを参照。
seed ワールドのシード値を表示する。シングルプレイでは、このコマンドはチートの有効無効によらず常に使用可能である。 常に成功する(コマンドブロックで、シングルプレイのプレイヤーにより、サーバーのオペレーターにより、の何れでも)。
spawnpoint <プレイヤー名> [x y z] 指定したプレイヤーのリスポーン地点を指定した座標にする。座標を指定しなければ現在の場所に設定する。座標 x y z が指定されない場合、プレイヤー名 も省略でき、現在の場所にコマンドを発行したプレイヤーのリスポーン地点を設定する。リスポーン座標は完全な値である必要がある。少数であってはならない。 プレイヤー名 のプレイヤーがオンラインで、xyz 座標が-30,000,000 から 30,000,000の範囲内(端を含む)の場合。
time set <数値 | day | night> ワールドの時間を設定する。数値 は0以上の数字で、0は日の出、6,000が正午、12,000が日没、18,000が真夜中になる。数値 は24,000を超えた値の場合、単純に24,000で割った余りと同じ扱いになる。「time set day」で時間を0に、「time set night」で12500に設定する。 数値 が0以上か、day、night というキーワードが指定されている場合。
time add <数値> ワールドの時間を、前述のように進める。 数値 が0か正の値の場合。
toggledownfall 降雨・降雪をトグル切り替えする。 常に成功する。
tp [プレイヤー名] <目標プレイヤー名> プレイヤー名 で指定したプレイヤーを 目標プレイヤー名 で指定したプレイヤーのいる場所へとテレポートさせる。プレイヤー名が一人だけなら、自身をテレポートさせる。 コマンドブロックでは プレイヤー名 は必須になる。両プレイヤーがオンラインである必要がある。
tp [プレイヤー名] <x> <y> <z> プレイヤー名 で指定したプレイヤー(未指定なら自分)をx, y, zで指定した座標へとテレポートさせる(y座標は0または正の値のみ)。座標の値の前に~を付けることで現在の場所からの相対値を指定できる。例えば「/tp John ~3 64 ~3」とすると、Johnというプレイヤーを南東へ3ブロック、Y座標は64に移動させる。 xz 座標が-30,000,000 から 30,000,000の範囲の内側(端は含まない)で、y が0以上の場合。コマンドブロックでは プレイヤー名 は必須で、そのプレイヤーがオンラインである必要がある。
weather <clear | rain | thunder> [秒数] 天候を晴れ(clear)、雨(rain)、雷雨(thunder)へと、指定された時間、一時的に変更する。寒冷バイオームでは雨ではなく雪が降る。 秒数 が1から100,000までで、天候名のキーワードが正しい場合。
xp <> [プレイヤー名] 指定した プレイヤー名 に経験値オーブを指定した点数与える。 に負の値を指定することは出来ない(この書式で経験レベルを奪うことは出来ない)。 は2,147,483,647までの数値である場合。またコマンドブロックでは プレイヤー名 は必須で、そのプレイヤーがオンラインである必要がある。
xp <>L [プレイヤー名] 指定した プレイヤー名 で指定した経験のレベルを与える。数字の最大は2,147,483,647になり、プレイヤーの経験レベルがこれを越えると0になる。負の値を指定することで、経験レベルを剥奪することが可能。 が-2,147,483,648以上2,147,483,647以下の場合。コマンドブロックでは プレイヤー名 は必須で、そのプレイヤーがオンラインである必要がある。

マルチプレイ限定コマンド

これらコマンドはop(オペレーター)がサーバーコンソールから、あるいはコマンド文字(スラッシュ記号)を頭に付けることでチャット画面から用いることが出来る。これらはマルチプレイでのみ利用可能である。list コマンド以外のものはコマンドブロックでは実行することは出来ず、目標選択子は使用できない。多くのコマンドがサーバー上に居たことがないプレイヤーに対して、あるいは Minecraft アカウントとして登録されていない(出来ない)名前が使用可能である。

コマンド 説明 成功条件
ban <プレイヤー名> [理由] サーバーのブラックリストに プレイヤー名 の名前を登録し、サーバーに接続できないようにする。注意: ブラックリストはホワイトリストよりも優先される[要検証] 常に成功する。
ban-ip <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 サーバーがワールドファイルに書き込むことを有効にする。これが通常の挙動。 常に成功する。
stop サーバーを停止する。 常に成功する。
whitelist <add | remove> <プレイヤー名> プレイヤー名 をホワイトリストに追加 (add)、削除 (remove) する。 常に成功する。
whitelist list ホワイトリスト中のプレイヤー名をすべて表示する。 常に成功する。
whitelist <on | off> サーバーでホワイトリストを使う (on) か使わない (off) かを切り替える。注意: サーバーのオペレーターは、ホワイトリスト中に名前が載っていなくとも常に接続可能となる。 常に成功する。
whitelist reload white-list.txtを読み込みなおし、ホワイトリストのプレイヤー名一覧を更新する(ファイルが Minecraft 外で変更された際に用いる)。 常に成功する。

コマンドブロック限定コマンド

コマンドブロックでのみ使用可能で、他では使えないコマンド。コマンドブロックは/give <プレイヤー名> 137でのみ得ることが可能。

コマンド 説明
testfor <プレイヤー名 | 選択子> プレイヤー名 のプレイヤーがオンラインであるか、あるいは 選択子 に該当があるかの確認を行う。レッドストーンコンパレーターを使いこのコマンドを実行するコマンドブロックの出力を引き出すことで、選択子 に該当するプレイヤー数を得る事が出来る。例えば「testfor @a[r=3]」とすることで、コマンドブロックの3m内のプレイヤー数に相当する信号レベルの信号が出力される。詳細についてはコマンドブロックの引数節を参照してほしい。

動画

History

Java Edition Classic
0.0.15a_03Added /ban, /banip, /broadcast, /deop, /kick, /op, /tp, and /unban.
0.0.16a_01Changed /broadcast to /say.
0.0.17aAdded /setspawn.
0.0.20aAdded /solid.
Java Edition Indev
0.31All commands removed.
Java Edition Alpha
1.0.16Added /ban, /ban-ip, /banlist, /deop, /home, /kick, /op, /pardon, /pardon-ip, /say, and /stop.
1.0.16_01Added /save-all, /save-on, /save-off and /tp.
1.0.16_02Added /list and /tell.
1.2.5Removed /home.
1.2.6Added /kill.
Java Edition Beta
1.3Added /whitelist.
Java Edition
1.3.112w16aAdded cheats mode and /gamemode, /give, /time, /toggledownfall, and /xp.
12w17aAdded /help.
12w21aAdded /seed.
12w22aAdded /defaultgamemode.
12w24aAdded /publish.
12w25aCheats can now be turned on or off when opening a world to other players through LAN.
12w27aAdded /debug.
?Added /me.
1.4.212w32aAdded /difficulty, /gamerule, /spawnpoint, and /weather.
Added target selectors.
12w37aAdded /clear.
12w38aAdded item arguments to /clear.
12w41aThe limit for /xp is now 2,147,483,647 instead of 5,000.
1.4.41.4.4-preAdded /enchant.
1.513w03aAdded /testfor.
13w04aAdded /scoreboard.
13w09bAdded /effect.
1.6.113w23aAdded /spreadplayers.
Added gamerule naturalRegeneration.
13w24aAdded gamerule doDaylightCycle.
13w24bThe damage dealt by /kill was changed from 1,000 to 3.4×1038.
1.6-preAdded clear argument to /effect.
1.6.1-preAdded /playsound.
1.7.213w36aAdded /summon.
Added /achievement.
Added dataTag argument to /give.
13w37aAdded /setblock, /tellraw, and /testforblock.
13w38aAdded /setidletimeout.
13w43aAdded /setworldspawn.
1.814w02aAdded /blockdata.
Added @e target selector.
Added player|entity argument to /kill.
Added data argument to /clear.
Added dataTag argument to /testfor.
/testfor is no longer exclusive to command blocks.
Added insertion attribute to raw JSON text specification.
14w02cTo fix MC-44371, /kill now directly kills non-living targets, rather than dealing 3.4×1038 void damage.
14w03aAdded rotation arguments to /tp.
Added dx, dy, and dz to target selector arguments.
Added /clone and /fill.
Added gamerule logAdminCommands.
NBT data now supports using string IDs rather than numerical IDs.
Numerical IDs no longer work in other parts of commands, though they still work for NBT data.
14w04aAdded /particle.
14w05aAdded spectator to /gamemode and /defaultgamemode.
14w06aAdded hideParticles argument to /effect.
Added /trigger.
14w07aAdded /execute and /testforblocks.
/testfor can now test for partial NBT tag matches.
14w08aCommands run using /execute now pass their success value back to the command block running them.
14w10aAdded gamerule showDeathMessages.
Added force option to /clone.
14w17aAdded /worldborder.
Added gamerule randomTickSpeed.
14w19aAdded /worldborder damage and /worldborder warning.
14w20aAdded /title.
Added selector attribute to raw JSON text specification.
Added move option to /clone.
14w26aAdded /worldborder add.
Added /replaceitem.
Added gamerule sendCommandFeedback
14w28aAdded /stats.
14w29aAdded /worldborder get.
Added force argument to /particle.
Added /time query.
Added the ability to create dummy gamerules.
Added QueryResults to /stats.
14w30a/summon can now spawn lightning.
14w31a/debug can be run in single player.
Added chunk argument to /debug.
14w32bAdded /entitydata.
/give can no longer make illegal stacks.
1.8.11.8.1-pre1Added the game rule doEntityDrops.
The game rule doTileDrops no longer affects entities.
1.915w43a/gamemode now displays in chat the gamemode the player switched to.
15w49a/playsound now accepts Tab to complete.
Added player and params tag to the /particle
15w49b/time query now accepts day as a value.
15w51aAdded gamerule spawnRadius.
16w02aThe m selector now accepts the standard literal gamemode values and abbreviations, such as a and adventure, and these may be negated as well.
/playsound now requires a source parameter, specifying what is the sound's category for volume purposes.
Running /help in a command block will now randomly use one of various different humorous phrases as the previous output.
16w03a/achievement no longer affects statistics.
16w07aAdded gamerule disableElytraMovementCheck.
1.9.3pre1/tp will no longer teleport the player to a y-coordinate outside the range -512 to 512.
pre2Added /stopsound.
1.1016w21bThe y-coordinate range of /tp is increased to -4096 to 4096.
1.10-pre1Added /teleport, which is like /tp, except that the target parameter is mandatory, the 'teleport to other player' usage is unavailable, and the use of relative coordinates is relative to the executor of the command, rather than relative to the target.
1.1116w32aAdded block state support to /execute, /fill, /setblock and /testforblock.
16w32bAdded ability for /title to display text in the action bar position.
16w38aAdded gamerules doWeatherCycle and maxEntityCramming.
Removed implicit target selectors (for example, @e[167,28,454]).
Invalid target selectors (such as @e[Type=creeper], @e[asdf=nonexistent], and @e[malformed]) now generate an error instead of being silently ignored.
16w39aAdded /locate.
Java Edition
1.1217w13aAdded /recipe and /advancement.
Added gamerule doLimitedCrafting.
Removed /achievement.
17w16bAdded gamerule maxCommandChainLength.
Pocket Edition Alpha
0.7.4Added support for commands, though none are implemented yet.
0.16.0build 1Added /clearfixedinv, /clone, /deop, /execute, /fill, /gamemode, /give, /help (with alias /?), /kill, /list, /op, /say, /setblock, /setfixedinvslot, /setworldspawn, /spawnpoint, /summon, /tell (with aliases /msg and /w), /testforblock, /testforblocks, /time, /toggledownfall, /tp (with alias /teleport), /weather, /wsserver and /xp.
Functionality of most commands is equivalent to PC 1.10 usage. Differences include: no support for datatags, /clone cannot use forced cloneMode, /gamemode can only use Creative and Survival modes, the player target is optional in /give, and the entity target is optional in /execute.
build 2Removed /clearfixedinv and /setfixedinvslot, along with other Education Edition -related items.
build 5Added /enchant.
Pocket Edition
1.0build 1Added /locate and /connect.
build 2Removed /locate.
build 3Re-added /locate. Only works for strongholds.
1.0.3build 1Added /transferserver.
1.0.5build 1Added /clear, /difficulty, /effect, /gamerule, /me, /particle, /playsound, /replaceitem, /spreadplayers, /stopsound, /testfor and /title.
build 2Removed /particle.
The amplifier on /effect can no longer have negative values.
Pocket Edition
1.1build 1The canplaceon and candestroy are now supported for /replaceitem.
/locate can now find other structures.
Added dodaylightcycle, doentitydrops, dofiretick, domobspawning, domobloot, dotiledrops, doweathercycle, keepinventory and mobgriefing gamerules.

豆知識

  • ゲームルール "doFireTick" が "false" にされると、炎は広がらないが、設置されたブロックの如何によらず燃え続け、雨で消え去ることも無くなる。これは雷雨の間は、落雷によりそれなりな数の火災が発生するのでプレイヤーがいちいち消して回らねばならなくなり、非常に困ったものになる。
  • ステータス効果「耐性」のレベル5(増幅度4)を得ているときは、/kill コマンドは機能しなくなる。
    • これはバージョン1.6で修正された(13w24bでも修正済み)。

関連項目