本文へスキップ
MC COMMANDS logoMC COMMANDS
コマンドリファレンス

Minecraft /execute Command

developerJava版統合版 (Bedrock)

別のエンティティ、場所、ディメンション、または条件に一致する perspectives からコマンドを実行します。

バージョン対応

Java版:1.21.4 (1.13+)
統合版 (Bedrock):1.21.60

コマンド構文

Java版/execute <subcommands...> run <command>
統合版 (Bedrock)/execute <subcommands...> run <command>

引数の解説

実用的な使用例

intermediate両エディション
/execute as @a at @s if block ~ ~-1 ~ minecraft:water run effect give @s speed 5 1 true

Gives speed boost to players who are currently standing on top of water.

Detecting ground blocks beneath players.

intermediate両エディション
/execute as @e[type=cow] at @s run summon lightning_bolt

Strikes a lightning bolt at every cow in loaded chunks.

Changing both identity and position context.

intermediateJava版
/execute in minecraft:the_nether run tp @s 0 64 0

Teleports the player to coordinates 0, 64, 0 in the Nether dimension.

Cross-dimensional teleportation.

advancedJava版
/execute store result score @p CoinCount run clear @p gold_nugget 0

Counts how many gold nuggets a player holds and stores the number in their CoinCount scoreboard.

Querying inventory amounts into variables without removing items.

advanced両エディション
/execute at @e[type=arrow] if block ~ ~-0.5 ~ minecraft:sand run setblock ~ ~-0.5 ~ minecraft:glass

Turns sand into glass wherever an arrow lands.

Dynamic projectile impact mechanics.

Advertisement

よくあるミス

ミス:

Java版の最終コマンドの前に「run」を忘れる

修正方法:

正しい構文: /execute as @p at @s run <command>(「run」を忘れないで)

ミス:

プレイヤーを追跡するために「positioned」を「at」の代わりに使う

修正方法:

「at @s」はエンティティの位置を追跡し、「positioned」は固定位置を設定します。

ミス:

「as」と「at」を混同 - 「as」は実行者を変え、「at」は位置を変える

修正方法:

「as @e」= Mobが実行、「at @e」= Mobの位置で実行。

Command Block Usage & Automation

The cornerstone of command block logic. Run a Repeating Always Active command block with "/execute as @a at @s if block ~ ~-1 ~ slime_block run effect give @s jump_boost 2 3 true" to create custom trampoline jump pads, or use conditional chain blocks following execute checks to only advance storylines when a puzzle condition is met.

Automation Tip: Command blocks require Operator permissions (permission level 2+) and cheats enabled. In Java Edition, command blocks can execute commands up to 32,767 characters long compared to the 256-character player chat limit.

便利なヒント

  • /executeはMinecraftで最も強力なコマンド - 条件を組み合わせて複雑な方法でコマンドを実行できます。

  • "as @e"でコマンドの実行者を変更し、"at @s"で実行場所を変更します。

  • "if block"と"unless block"を組み合わせて、ブロックベースの条件付きコマンドを作成します。

  • プレイヤーが水の中にいるかなどの条件を確認する前に/executeを使用してください。

  • サブコマンド"anchored eyes"は足元ではなくエンティティの目の位置からコマンドを実行します。

重要な注意事項

Bedrock版以前はより簡単な構文を使用していました: `/execute <origin> <position> <command>`。しかし、Bedrock版は現在Javaに似たチェーン構文をネイティブにサポートしており、最新の更新でほぼ統一されています。

よくある質問

関連コマンド

コマンドを作成しますか?

ビジュアルインターフェースで/executeコマンドをエラーなしに作成できるインタラクティブジェネレーター。

コマンドジェネレーターを開く
Advertisement