Minecraft /execute Command
Führt einen Befehl aus der Perspektive einer anderen Entität, eines anderen Standorts, einer anderen Dimension oder unter Abgleich von Bedingungen aus.
Versionskompatibilität
Befehlssyntax
/execute <subcommands...> run <command>/execute <subcommands...> run <command>Argumente Erklärt
as <entity>SubcommandChanges who the executor (@s) is, without moving where the command runs.
at <entity>SubcommandChanges execution position (~ ~ ~), rotation, and dimension to match the entity.
positioned <pos>SubcommandExplicitly moves the execution location to coordinates (absolute or relative).
in <dimension>SubcommandExecutes within minecraft:overworld, the_nether, or the_end.
if / unless <condition>SubcommandEvaluates block matches, entity counts, score comparisons, or predicates before running.
store (result|success)SubcommandStores the numeric result or success count of the command into a scoreboard or NBT path.
run <command>TerminatorErforderlichThe terminating command executed if all modifiers and condition checks succeed.
Praktische Beispiele
/execute as @a at @s if block ~ ~-1 ~ minecraft:water run effect give @s speed 5 1 trueGives speed boost to players who are currently standing on top of water.
Detecting ground blocks beneath players.
/execute as @e[type=cow] at @s run summon lightning_boltStrikes a lightning bolt at every cow in loaded chunks.
Changing both identity and position context.
/execute in minecraft:the_nether run tp @s 0 64 0Teleports the player to coordinates 0, 64, 0 in the Nether dimension.
Cross-dimensional teleportation.
/execute store result score @p CoinCount run clear @p gold_nugget 0Counts how many gold nuggets a player holds and stores the number in their CoinCount scoreboard.
Querying inventory amounts into variables without removing items.
/execute at @e[type=arrow] if block ~ ~-0.5 ~ minecraft:sand run setblock ~ ~-0.5 ~ minecraft:glassTurns sand into glass wherever an arrow lands.
Dynamic projectile impact mechanics.
Häufige Fehler
Fehler:
Vergessen von "run" vor dem letzten Befehl in Java
Lösung:
Die richtige Syntax ist: /execute as @p at @s run <command> (vergessen Sie "run" nicht)
Fehler:
"positioned" statt "at" verwenden um einem Spieler zu folgen
Lösung:
"at @s" folgt der Position der Entität, "positioned" setzt eine feste Position.
Fehler:
"as" und "at" verwechseln - "as" ändert den Ausführer, "at" ändert die Position
Lösung:
"as @e" = Mobs führen aus ; "at @e" = wird an der Position der Mobs ausgeführt.
Unterschiede Java vs Bedrock
Beide Editionen unterstützen jetzt die verkettete /execute-Syntax. Java verwendet `-> run`, während Bedrock `run` direkt verwendet. Die Funktionalität ist in modernen Updates im Wesentlichen gleich.
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.
Nützliche Tipps
/execute ist der mächtigste Befehl in Minecraft - er ermöglicht die Kombination von Bedingungen und die komplexe Ausführung von Befehlen.
Verwenden Sie "as @e" um zu ändern, wer den Befehl ausführt, und "at @s" um zu ändern, wo er ausgeführt wird.
Kombinieren Sie "if block" und "unless block" um bedingte blockbasierte Befehle zu erstellen.
Verwenden Sie /execute um Bedingungen vor der Ausführung zu prüfen, wie z.B. ob ein Spieler im Wasser steht.
Der Unterbefehl "anchored eyes" führt den Befehl von der Augenposition der Entität aus, nicht von den Füßen.
Wichtige Hinweise
Bedrock verwendete zuvor eine einfachere Syntax. Allerdings unterstützt jetzt nativ die Java-ähnliche verkettete Syntax, was sie in modernen Updates sehr vereinheitlicht.
Häufig Gestellte Fragen
Kann ich einen Befehl ausführen als wäre ich ein anderer Spieler?
Ja: /execute as PlayerName at @s run <command> führt den Befehl als dieser Spieler an dessen Position aus.
Kann ich einen Befehl in einer anderen Dimension ausführen?
Ja: /execute in the_nether run <command> führt den Befehl im Nether aus.
Kann ich einen Befehl nur unter einer Bedingung ausführen?
Ja: /execute if block ~ ~-1 ~ water run say Ich bin im Wasser!
Verwandte Befehle
Bereit, Ihren Befehl zu erstellen?
Verwenden Sie unseren interaktiven Generator, um fehlerfreie /execute Befehle mit einer visuellen Oberfläche zu erstellen.
Befehlsgenerator Öffnen