Minecraft /execute Command
Esegue un comando dalla prospettiva di un'altra entità, posizione, dimensione o abbinando delle condizioni.
Compatibilità Versioni
Sintassi del Comando
/execute <subcommands...> run <command>/execute <subcommands...> run <command>Argomenti Spiegati
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>TerminatorObbligatorioThe terminating command executed if all modifiers and condition checks succeed.
Esempi Pratici
/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.
Errori Comuni
Errore:
Dimenticare "run" prima del comando finale in Java
Correzione:
La sintassi corretta è: /execute as @p at @s run <command> (non dimenticate "run")
Errore:
Usare "positioned" invece di "at" per seguire un giocatore
Correzione:
"at @s" segue la posizione dell'entità, "positioned" imposta una posizione fissa.
Errore:
Confondere "as" e "at" - "as" cambia l'esecutore, "at" cambia la posizione
Correzione:
"as @e" = i mob eseguono ; "at @e" = si esegue dove sono i mob.
Differenze Java vs Bedrock
Entrambe le edizioni ora supportano la sintassi concatenata di /execute. Java usa `-> run` mentre Bedrock usa `run` direttamente. La funzionalità è essenzialmente la stessa negli aggiornamenti moderni.
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.
Suggerimenti Utili
/execute è il comando più potente di Minecraft - permette di combinare condizioni ed eseguire comandi in modi complessi.
Usa "as @e" per cambiare chi esegue il comando, e "at @s" per cambiare da dove viene eseguito.
Combina "if block" e "unless block" per creare comandi condizionali basati sui blocchi.
Usa /execute per verificare le condizioni prima di eseguire un comando, come controllare se un giocatore è in acqua.
Il sotto-comando "anchored eyes" esegue il comando dalla posizione degli occhi dell'entità invece che dai piedi.
Note Importanti
Bedrock precedentemente usava una sintassi più semplice. Tuttavia, Bedrock ora supporta nativamente la sintassi concatenata simile a Java, rendendole altamente unificate negli aggiornamenti moderni.
Domande Frequenti
Posso eseguire un comando come se fossi un altro giocatore?
Sì: /execute as PlayerName at @s run <command> esegue il comando come quel giocatore alla sua posizione.
Posso eseguire un comando in un'altra dimensione?
Sì: /execute in the_nether run <command> esegue il comando nel Nether.
Posso eseguire un comando solo se una condizione è soddisfatta?
Sì: /execute if block ~ ~-1 ~ water run say Sono in acqua!
Comandi Correlati
Pronto a creare il tuo comando?
Usa il nostro generatore interattivo per creare comandi /execute senza errori con un'interfaccia visuale.
Apri il Generatore di Comandi