Notizie
Gioco
Guide
Download
Versioni
/execute
COMANDI BLOCCHI COMANDI E MAPPE TRUCCHI · LIVELLO 2 14 SOTTOCOMANDI Aggiunto in 1.14 o precedente

/execute comando in Minecraft

/execute esegue un altro comando in un contesto modificato: come un'altra entità, da un'altra posizione o dimensione, oppure solo se una verifica riesce. Può anche salvare il risultato del comando in un punteggio o in dati NBT. Quasi ogni mappa e ogni pacchetto di dati si basa su di esso.

Sintassi

/execute (align|anchored|as|at|facing|if|in|on|positioned|rotated|run|store|summon|unless)
Tutte le 154 forme
  • /execute align <axes> …
  • /execute anchored <anchor> …
  • /execute as <targets> …
  • /execute at <targets> …
  • /execute facing entity <targets> <anchor> …
  • /execute facing <pos> …
  • /execute if biome <pos> <biome>
  • /execute if biome <pos> <biome> …
  • /execute if block <pos> <block>
  • /execute if block <pos> <block> …
  • /execute if blocks <start> <end> <destination> all
  • /execute if blocks <start> <end> <destination> all …
  • /execute if blocks <start> <end> <destination> masked
  • /execute if blocks <start> <end> <destination> masked …
  • /execute if data block <source> <path>
  • /execute if data block <source> <path> …
  • /execute if data entity <source> <path>
  • /execute if data entity <source> <path> …
  • /execute if data storage <source> <path>
  • /execute if data storage <source> <path> …
  • /execute if dimension <dimension>
  • /execute if dimension <dimension> …
  • /execute if entity <entities>
  • /execute if entity <entities> …
  • /execute if function <name> …
  • /execute if items block <source> <slots> <item_predicate>
  • /execute if items block <source> <slots> <item_predicate> …
  • /execute if items entity <source> <slots> <item_predicate>
  • /execute if items entity <source> <slots> <item_predicate> …
  • /execute if loaded <pos>
  • /execute if loaded <pos> …
  • /execute if predicate <predicate>
  • /execute if predicate <predicate> …
  • /execute if score <target> <targetObjective> < <source> <sourceObjective>
  • /execute if score <target> <targetObjective> < <source> <sourceObjective> …
  • /execute if score <target> <targetObjective> <= <source> <sourceObjective>
  • /execute if score <target> <targetObjective> <= <source> <sourceObjective> …
  • /execute if score <target> <targetObjective> = <source> <sourceObjective>
  • /execute if score <target> <targetObjective> = <source> <sourceObjective> …
  • /execute if score <target> <targetObjective> > <source> <sourceObjective>
  • /execute if score <target> <targetObjective> > <source> <sourceObjective> …
  • /execute if score <target> <targetObjective> >= <source> <sourceObjective>
  • /execute if score <target> <targetObjective> >= <source> <sourceObjective> …
  • /execute if score <target> <targetObjective> matches <range>
  • /execute if score <target> <targetObjective> matches <range> …
  • /execute if slots block <source> <slots>
  • /execute if slots block <source> <slots> …
  • /execute if slots entity <source> <slots>
  • /execute if slots entity <source> <slots> …
  • /execute if stopwatch <id> <range>
  • /execute if stopwatch <id> <range> …
  • /execute in <dimension> …
  • /execute on attacker …
  • /execute on controller …
  • /execute on leasher …
  • /execute on origin …
  • /execute on owner …
  • /execute on passengers …
  • /execute on target …
  • /execute on vehicle …
  • /execute positioned as <targets> …
  • /execute positioned over <heightmap> …
  • /execute positioned <pos> …
  • /execute rotated as <targets> …
  • /execute rotated <rot> …
  • /execute run …
  • /execute store result block <target> <path> byte <scale> …
  • /execute store result block <target> <path> double <scale> …
  • /execute store result block <target> <path> float <scale> …
  • /execute store result block <target> <path> int <scale> …
  • /execute store result block <target> <path> long <scale> …
  • /execute store result block <target> <path> short <scale> …
  • /execute store result bossbar <id> max …
  • /execute store result bossbar <id> value …
  • /execute store result entity <target> <path> byte <scale> …
  • /execute store result entity <target> <path> double <scale> …
  • /execute store result entity <target> <path> float <scale> …
  • /execute store result entity <target> <path> int <scale> …
  • /execute store result entity <target> <path> long <scale> …
  • /execute store result entity <target> <path> short <scale> …
  • /execute store result score <targets> <objective> …
  • /execute store result storage <target> <path> byte <scale> …
  • /execute store result storage <target> <path> double <scale> …
  • /execute store result storage <target> <path> float <scale> …
  • /execute store result storage <target> <path> int <scale> …
  • /execute store result storage <target> <path> long <scale> …
  • /execute store result storage <target> <path> short <scale> …
  • /execute store success block <target> <path> byte <scale> …
  • /execute store success block <target> <path> double <scale> …
  • /execute store success block <target> <path> float <scale> …
  • /execute store success block <target> <path> int <scale> …
  • /execute store success block <target> <path> long <scale> …
  • /execute store success block <target> <path> short <scale> …
  • /execute store success bossbar <id> max …
  • /execute store success bossbar <id> value …
  • /execute store success entity <target> <path> byte <scale> …
  • /execute store success entity <target> <path> double <scale> …
  • /execute store success entity <target> <path> float <scale> …
  • /execute store success entity <target> <path> int <scale> …
  • /execute store success entity <target> <path> long <scale> …
  • /execute store success entity <target> <path> short <scale> …
  • /execute store success score <targets> <objective> …
  • /execute store success storage <target> <path> byte <scale> …
  • /execute store success storage <target> <path> double <scale> …
  • /execute store success storage <target> <path> float <scale> …
  • /execute store success storage <target> <path> int <scale> …
  • /execute store success storage <target> <path> long <scale> …
  • /execute store success storage <target> <path> short <scale> …
  • /execute summon <entity> …
  • /execute unless biome <pos> <biome>
  • /execute unless biome <pos> <biome> …
  • /execute unless block <pos> <block>
  • /execute unless block <pos> <block> …
  • /execute unless blocks <start> <end> <destination> all
  • /execute unless blocks <start> <end> <destination> all …
  • /execute unless blocks <start> <end> <destination> masked
  • /execute unless blocks <start> <end> <destination> masked …
  • /execute unless data block <source> <path>
  • /execute unless data block <source> <path> …
  • /execute unless data entity <source> <path>
  • /execute unless data entity <source> <path> …
  • /execute unless data storage <source> <path>
  • /execute unless data storage <source> <path> …
  • /execute unless dimension <dimension>
  • /execute unless dimension <dimension> …
  • /execute unless entity <entities>
  • /execute unless entity <entities> …
  • /execute unless function <name> …
  • /execute unless items block <source> <slots> <item_predicate>
  • /execute unless items block <source> <slots> <item_predicate> …
  • /execute unless items entity <source> <slots> <item_predicate>
  • /execute unless items entity <source> <slots> <item_predicate> …
  • /execute unless loaded <pos>
  • /execute unless loaded <pos> …
  • /execute unless predicate <predicate>
  • /execute unless predicate <predicate> …
  • /execute unless score <target> <targetObjective> < <source> <sourceObjective>
  • /execute unless score <target> <targetObjective> < <source> <sourceObjective> …
  • /execute unless score <target> <targetObjective> <= <source> <sourceObjective>
  • /execute unless score <target> <targetObjective> <= <source> <sourceObjective> …
  • /execute unless score <target> <targetObjective> = <source> <sourceObjective>
  • /execute unless score <target> <targetObjective> = <source> <sourceObjective> …
  • /execute unless score <target> <targetObjective> > <source> <sourceObjective>
  • /execute unless score <target> <targetObjective> > <source> <sourceObjective> …
  • /execute unless score <target> <targetObjective> >= <source> <sourceObjective>
  • /execute unless score <target> <targetObjective> >= <source> <sourceObjective> …
  • /execute unless score <target> <targetObjective> matches <range>
  • /execute unless score <target> <targetObjective> matches <range> …
  • /execute unless slots block <source> <slots>
  • /execute unless slots block <source> <slots> …
  • /execute unless slots entity <source> <slots>
  • /execute unless slots entity <source> <slots> …
  • /execute unless stopwatch <id> <range>
  • /execute unless stopwatch <id> <range> …
/execute align
/execute align <axes> …
ArgomentoAccettaA cosa serve
axesAssi (xyz)Assi arrotondati per difetto a blocchi interi, in qualsiasi ordine: x, xz o xyz.
/execute anchored
/execute anchored <anchor> …
ArgomentoAccettaA cosa serve
anchoreyes / feeteyes o feet: il punto da cui partono le coordinate locali ^ ^ ^ e facing.
/execute as
/execute as <targets> …
ArgomentoAccettaA cosa serve
targetsSelettore di entitàuno o piùEntità che diventano l'esecutore (@s). Il resto della catena gira una volta per entità.
/execute at
/execute at <targets> …
ArgomentoAccettaA cosa serve
targetsSelettore di entitàuno o piùEntità di cui si usano posizione, rotazione e dimensione. L'esecutore non cambia.
/execute facing
/execute facing (entity|<pos>)
ArgomentoAccettaA cosa serve
targetsSelettore di entitàuno o piùEntità verso cui guardare; l'ancora che segue sceglie occhi o piedi.
anchoreyes / feeteyes o feet: il punto da cui partono le coordinate locali ^ ^ ^ e facing.
posPosizione (x y z)Coordinate assolute (0 64 0), relative (~ ~1 ~) o locali (^ ^ ^2).
Tutte le 2 forme
  • /execute facing entity <targets> <anchor> …
  • /execute facing <pos> …
/execute if
/execute if (biome|block|blocks|data|dimension|entity|function|items|loaded|predicate|score|slots|stopwatch)
ArgomentoAccettaA cosa serve
posCoordinate del blocco (x y z)Coordinate del blocco da verificare, per esempio ~ ~-1 ~ per il blocco sotto l'esecutore.
biomeID o #tag · biomeID o tag di bioma da verificare, per esempio minecraft:plains o #minecraft:is_ocean.
blockTest su bloccoBlocco da cercare, con stati facoltativi o come tag, per esempio minecraft:chest o #minecraft:logs.
startCoordinate del blocco (x y z)Primo angolo dell'area che viene confrontata.
endCoordinate del blocco (x y z)Angolo opposto dell'area che viene confrontata.
destinationCoordinate del blocco (x y z)Angolo inferiore nord-ovest della seconda area, quella con cui si confronta.
sourceCoordinate del blocco (x y z)Cosa leggere: coordinate di un blocco, un'entità, l'ID di un contenitore o un detentore di punteggio, secondo la parola chiave precedente.
pathPercorso NBTPercorso NBT da verificare, come Inventory[0] o Health. La verifica riesce se il percorso esiste.
dimensionDimensioneID della dimensione: minecraft:overworld, minecraft:the_nether o minecraft:the_end.
entitiesSelettore di entitàuno o piùSelettore da verificare. Il controllo riesce se almeno un'entità corrisponde.
nameFunzioneFunzione o tag di funzioni da eseguire. La verifica riesce se restituisce un valore diverso da 0.
slotsSlotSlot o intervallo di slot, per esempio weapon.mainhand, armor.head o container.*.
item_predicateTest su oggettoOggetto da cercare: un ID, un tag, * per qualsiasi oggetto o un ID con controlli sui componenti.
predicatePredicatoID di un file predicato di un pacchetto di dati, per esempio mypack:is_night.
targetTitolare del punteggiounoDetentore del punteggio da verificare: @s, il nome di un giocatore o un nome fittizio.
targetObjectiveObiettivo del punteggioObiettivo che contiene il punteggio da verificare.
sourceObjectiveObiettivo del punteggioObiettivo del punteggio con cui si confronta.
rangeIntervallo (1..5)Valori accettati: 5 esatto, 1..10 compreso tra, 10.. almeno, ..3 al massimo. Per i cronometri, in secondi.
idID di risorsaID del cronometro da verificare, creato con /stopwatch create.
Tutte le 45 forme
  • /execute if biome <pos> <biome>
  • /execute if biome <pos> <biome> …
  • /execute if block <pos> <block>
  • /execute if block <pos> <block> …
  • /execute if blocks <start> <end> <destination> all
  • /execute if blocks <start> <end> <destination> all …
  • /execute if blocks <start> <end> <destination> masked
  • /execute if blocks <start> <end> <destination> masked …
  • /execute if data block <source> <path>
  • /execute if data block <source> <path> …
  • /execute if data entity <source> <path>
  • /execute if data entity <source> <path> …
  • /execute if data storage <source> <path>
  • /execute if data storage <source> <path> …
  • /execute if dimension <dimension>
  • /execute if dimension <dimension> …
  • /execute if entity <entities>
  • /execute if entity <entities> …
  • /execute if function <name> …
  • /execute if items block <source> <slots> <item_predicate>
  • /execute if items block <source> <slots> <item_predicate> …
  • /execute if items entity <source> <slots> <item_predicate>
  • /execute if items entity <source> <slots> <item_predicate> …
  • /execute if loaded <pos>
  • /execute if loaded <pos> …
  • /execute if predicate <predicate>
  • /execute if predicate <predicate> …
  • /execute if score <target> <targetObjective> < <source> <sourceObjective>
  • /execute if score <target> <targetObjective> < <source> <sourceObjective> …
  • /execute if score <target> <targetObjective> <= <source> <sourceObjective>
  • /execute if score <target> <targetObjective> <= <source> <sourceObjective> …
  • /execute if score <target> <targetObjective> = <source> <sourceObjective>
  • /execute if score <target> <targetObjective> = <source> <sourceObjective> …
  • /execute if score <target> <targetObjective> > <source> <sourceObjective>
  • /execute if score <target> <targetObjective> > <source> <sourceObjective> …
  • /execute if score <target> <targetObjective> >= <source> <sourceObjective>
  • /execute if score <target> <targetObjective> >= <source> <sourceObjective> …
  • /execute if score <target> <targetObjective> matches <range>
  • /execute if score <target> <targetObjective> matches <range> …
  • /execute if slots block <source> <slots>
  • /execute if slots block <source> <slots> …
  • /execute if slots entity <source> <slots>
  • /execute if slots entity <source> <slots> …
  • /execute if stopwatch <id> <range>
  • /execute if stopwatch <id> <range> …
/execute in
/execute in <dimension> …
ArgomentoAccettaA cosa serve
dimensionDimensioneID della dimensione: minecraft:overworld, minecraft:the_nether o minecraft:the_end.
/execute onAggiunto in 1.19.4
/execute on (attacker|controller|leasher|origin|owner|passengers|target|vehicle)
Tutte le 8 forme
  • /execute on attacker …
  • /execute on controller …
  • /execute on leasher …
  • /execute on origin …
  • /execute on owner …
  • /execute on passengers …
  • /execute on target …
  • /execute on vehicle …
/execute positioned
/execute positioned (as|over|<pos>)
ArgomentoAccettaA cosa serve
targetsSelettore di entitàuno o piùEntità di cui si usa la posizione, senza rotazione né dimensione.
heightmapMappa delle altezzeMappa delle altezze che fissa la quota: world_surface, motion_blocking, motion_blocking_no_leaves o ocean_floor.
posPosizione (x y z)Coordinate assolute (0 64 0), relative (~ ~1 ~) o locali (^ ^ ^2).
Tutte le 3 forme
  • /execute positioned as <targets> …
  • /execute positioned over <heightmap> …
  • /execute positioned <pos> …
/execute rotated
/execute rotated (as|<rot>)
ArgomentoAccettaA cosa serve
targetsSelettore di entitàuno o piùEntità di cui si usa la rotazione, senza spostare la posizione attuale.
rotRotazione (imbardata beccheggio)Rotazione come imbardata e beccheggio, per esempio 90 0, oppure ~ ~ per valori relativi.
Tutte le 2 forme
  • /execute rotated as <targets> …
  • /execute rotated <rot> …
/execute run
/execute run …
/execute store
/execute store (result|success)
ArgomentoAccettaA cosa serve
targetCoordinate del blocco (x y z)Dove va il valore: coordinate di un blocco, un'entità o l'ID di un contenitore, secondo la parola chiave.
pathPercorso NBTPercorso NBT che riceve il valore, seguito dal tipo: byte, short, int, long, float o double.
scaleNumeroFattore applicato prima di salvare il valore, per esempio 0.01 o 100.
idID di risorsaID della barra superiore il cui valore o massimo riceve il risultato.
targetsTitolare del punteggiouno o piùDetentori che ricevono il valore: @s, @a, il nome di un giocatore o un nome fittizio.
objectiveObiettivo del punteggioObiettivo che riceve il valore salvato.
Tutte le 42 forme
  • /execute store result block <target> <path> byte <scale> …
  • /execute store result block <target> <path> double <scale> …
  • /execute store result block <target> <path> float <scale> …
  • /execute store result block <target> <path> int <scale> …
  • /execute store result block <target> <path> long <scale> …
  • /execute store result block <target> <path> short <scale> …
  • /execute store result bossbar <id> max …
  • /execute store result bossbar <id> value …
  • /execute store result entity <target> <path> byte <scale> …
  • /execute store result entity <target> <path> double <scale> …
  • /execute store result entity <target> <path> float <scale> …
  • /execute store result entity <target> <path> int <scale> …
  • /execute store result entity <target> <path> long <scale> …
  • /execute store result entity <target> <path> short <scale> …
  • /execute store result score <targets> <objective> …
  • /execute store result storage <target> <path> byte <scale> …
  • /execute store result storage <target> <path> double <scale> …
  • /execute store result storage <target> <path> float <scale> …
  • /execute store result storage <target> <path> int <scale> …
  • /execute store result storage <target> <path> long <scale> …
  • /execute store result storage <target> <path> short <scale> …
  • /execute store success block <target> <path> byte <scale> …
  • /execute store success block <target> <path> double <scale> …
  • /execute store success block <target> <path> float <scale> …
  • /execute store success block <target> <path> int <scale> …
  • /execute store success block <target> <path> long <scale> …
  • /execute store success block <target> <path> short <scale> …
  • /execute store success bossbar <id> max …
  • /execute store success bossbar <id> value …
  • /execute store success entity <target> <path> byte <scale> …
  • /execute store success entity <target> <path> double <scale> …
  • /execute store success entity <target> <path> float <scale> …
  • /execute store success entity <target> <path> int <scale> …
  • /execute store success entity <target> <path> long <scale> …
  • /execute store success entity <target> <path> short <scale> …
  • /execute store success score <targets> <objective> …
  • /execute store success storage <target> <path> byte <scale> …
  • /execute store success storage <target> <path> double <scale> …
  • /execute store success storage <target> <path> float <scale> …
  • /execute store success storage <target> <path> int <scale> …
  • /execute store success storage <target> <path> long <scale> …
  • /execute store success storage <target> <path> short <scale> …
/execute summonAggiunto in 1.19.4
/execute summon <entity> …
ArgomentoAccettaA cosa serve
entityID · entity_typeTipo di entità da generare, per esempio minecraft:armor_stand o minecraft:marker.
/execute unless
/execute unless (biome|block|blocks|data|dimension|entity|function|items|loaded|predicate|score|slots|stopwatch)
ArgomentoAccettaA cosa serve
posCoordinate del blocco (x y z)Coordinate del blocco da verificare, per esempio ~ ~-1 ~ per il blocco sotto l'esecutore.
biomeID o #tag · biomeID o tag di bioma da verificare, per esempio minecraft:plains o #minecraft:is_ocean.
blockTest su bloccoBlocco da cercare, con stati facoltativi o come tag, per esempio minecraft:chest o #minecraft:logs.
startCoordinate del blocco (x y z)Primo angolo dell'area che viene confrontata.
endCoordinate del blocco (x y z)Angolo opposto dell'area che viene confrontata.
destinationCoordinate del blocco (x y z)Angolo inferiore nord-ovest della seconda area, quella con cui si confronta.
sourceCoordinate del blocco (x y z)Cosa leggere: coordinate di un blocco, un'entità, l'ID di un contenitore o un detentore di punteggio, secondo la parola chiave precedente.
pathPercorso NBTPercorso NBT da verificare, come Inventory[0] o Health. La verifica riesce se il percorso esiste.
dimensionDimensioneID della dimensione: minecraft:overworld, minecraft:the_nether o minecraft:the_end.
entitiesSelettore di entitàuno o piùSelettore da verificare. Il controllo riesce se almeno un'entità corrisponde.
nameFunzioneFunzione o tag di funzioni da eseguire. La verifica riesce se restituisce un valore diverso da 0.
slotsSlotSlot o intervallo di slot, per esempio weapon.mainhand, armor.head o container.*.
item_predicateTest su oggettoOggetto da cercare: un ID, un tag, * per qualsiasi oggetto o un ID con controlli sui componenti.
predicatePredicatoID di un file predicato di un pacchetto di dati, per esempio mypack:is_night.
targetTitolare del punteggiounoDetentore del punteggio da verificare: @s, il nome di un giocatore o un nome fittizio.
targetObjectiveObiettivo del punteggioObiettivo che contiene il punteggio da verificare.
sourceObjectiveObiettivo del punteggioObiettivo del punteggio con cui si confronta.
rangeIntervallo (1..5)Valori accettati: 5 esatto, 1..10 compreso tra, 10.. almeno, ..3 al massimo. Per i cronometri, in secondi.
idID di risorsaID del cronometro da verificare, creato con /stopwatch create.
Tutte le 45 forme
  • /execute unless biome <pos> <biome>
  • /execute unless biome <pos> <biome> …
  • /execute unless block <pos> <block>
  • /execute unless block <pos> <block> …
  • /execute unless blocks <start> <end> <destination> all
  • /execute unless blocks <start> <end> <destination> all …
  • /execute unless blocks <start> <end> <destination> masked
  • /execute unless blocks <start> <end> <destination> masked …
  • /execute unless data block <source> <path>
  • /execute unless data block <source> <path> …
  • /execute unless data entity <source> <path>
  • /execute unless data entity <source> <path> …
  • /execute unless data storage <source> <path>
  • /execute unless data storage <source> <path> …
  • /execute unless dimension <dimension>
  • /execute unless dimension <dimension> …
  • /execute unless entity <entities>
  • /execute unless entity <entities> …
  • /execute unless function <name> …
  • /execute unless items block <source> <slots> <item_predicate>
  • /execute unless items block <source> <slots> <item_predicate> …
  • /execute unless items entity <source> <slots> <item_predicate>
  • /execute unless items entity <source> <slots> <item_predicate> …
  • /execute unless loaded <pos>
  • /execute unless loaded <pos> …
  • /execute unless predicate <predicate>
  • /execute unless predicate <predicate> …
  • /execute unless score <target> <targetObjective> < <source> <sourceObjective>
  • /execute unless score <target> <targetObjective> < <source> <sourceObjective> …
  • /execute unless score <target> <targetObjective> <= <source> <sourceObjective>
  • /execute unless score <target> <targetObjective> <= <source> <sourceObjective> …
  • /execute unless score <target> <targetObjective> = <source> <sourceObjective>
  • /execute unless score <target> <targetObjective> = <source> <sourceObjective> …
  • /execute unless score <target> <targetObjective> > <source> <sourceObjective>
  • /execute unless score <target> <targetObjective> > <source> <sourceObjective> …
  • /execute unless score <target> <targetObjective> >= <source> <sourceObjective>
  • /execute unless score <target> <targetObjective> >= <source> <sourceObjective> …
  • /execute unless score <target> <targetObjective> matches <range>
  • /execute unless score <target> <targetObjective> matches <range> …
  • /execute unless slots block <source> <slots>
  • /execute unless slots block <source> <slots> …
  • /execute unless slots entity <source> <slots>
  • /execute unless slots entity <source> <slots> …
  • /execute unless stopwatch <id> <range>
  • /execute unless stopwatch <id> <range> …

Esempi

Velocità sui blocchi d'oro

/execute as @a at @s if block ~ ~-1 ~ minecraft:gold_block run effect give @s minecraft:speed 5 1 true

Ogni giocatore che sta su un Blocco d'oro riceve Velocità II per 5 secondi, senza particelle. Mettilo in un blocco comandi a ripetizione.

Java 26.3

Avvisare se ci sono zombi vicini

/execute as @a at @s if entity @e[type=minecraft:zombie,distance=..8] run title @s actionbar {"text":"Zombi nelle vicinanze!","color":"red"}

Ogni giocatore con uno zombi entro 8 blocchi vede un avviso rosso sopra la barra rapida.

Java 26.3

Etichettare chi ha 10 uccisioni

/execute as @a if score @s kills matches 10.. run tag @s add veteran

Aggiunge l'etichetta veteran a ogni giocatore con un punteggio kills di 10 o più.

Java 26.3

Dare una bussola a chi non ce l'ha

/execute as @a[gamemode=adventure] unless items entity @s container.* minecraft:compass run give @s minecraft:compass

I giocatori in modalità avventura senza una bussola nell'inventario ne ricevono una.

Java 26.3

Salvare l'altezza di un giocatore

/execute as @p store result score @s y_pos run data get entity @s Pos[1]

Copia la coordinata Y del giocatore più vicino nel punteggio y_pos come numero intero. L'obiettivo deve esistere.

Java 26.3

Contare gli zombi caricati

/execute store result score zombie_count stats if entity @e[type=minecraft:zombie]

Salva il numero di zombi nei chunk caricati nel nome fittizio zombie_count dell'obiettivo stats.

Java 26.3

Particella cinque blocchi avanti

/execute as @p at @s anchored eyes positioned ^ ^ ^5 run particle minecraft:flame ~ ~ ~

Mostra una fiamma 5 blocchi davanti agli occhi del giocatore più vicino, nella direzione in cui guarda.

Java 26.3

Teletrasportarsi nel Nether

/execute in minecraft:the_nether run teleport @s 0 100 0

Ti porta a X 0, Y 100, Z 0 nel Nether. Controlla prima il punto: potresti finire dentro la netherrack.

Java 26.3
Componi il tuo comando

Compila i campi, poi copia il comando.

Generatore di comandi

Come funziona la catena

/execute legge i sottocomandi da sinistra a destra e ognuno modifica il contesto di tutto ciò che segue. run va sempre in fondo, seguito da un normale comando senza barra. as cambia l'esecutore: @s indica ora quell'entità, ma la posizione resta la stessa. at prende posizione, rotazione e dimensione dell'entità senza cambiare l'esecutore. Per questo tanti comandi iniziano con execute as @a at @s: ogni giocatore esegue il comando ai propri piedi. Con positioned, rotated, facing, anchored, align e in regoli il contesto nel dettaglio. Se un selettore trova più entità, il resto della catena viene eseguito una volta per ciascuna.

Condizioni e risultati salvati

if e unless interrompono il ramo quando la verifica fallisce. Possono controllare blocchi, entità, punteggi, dati NBT, oggetti, biomi, dimensioni, predicati, funzioni e cronometri. Senza run, il comando segnala solo «Il collaudo è stato superato» o «Il collaudo non è stato superato», con la quantità per le entità. store result e store success scrivono l'esito dell'ultimo comando in un punteggio di /scoreboard, nei dati NBT di un'entità o di un blocco, in un contenitore o in una barra superiore. Insieme a /data trasformi i valori NBT in punteggi.

Consigli

  • summon crea un'entità e la rende subito esecutore; on owner, on vehicle o on attacker passano a un'entità collegata.
  • In un Blocco comandi a ripetizione o in una funzione eseguita a ogni tick, restringi i selettori come @e[type=zombie,distance=..10] per non rallentare il gioco.
  • Le catene lunghe si leggono meglio in un file di /function.

✓ Verificato nella Java Edition 26.3 · aggiornato il 2 novembre 2026

/execute: FAQ

Perché /execute as @a non usa la posizione del giocatore?

as cambia solo chi esegue il comando. Aggiungi at @s subito dopo, così anche la posizione passa a ogni giocatore.

/execute può eseguire più comandi insieme?

No, run accetta un solo comando. Metti i comandi in una funzione e usa run function: esecutore e posizione restano gli stessi.

Come si usa /execute?

Scrivilo in chat con i trucchi attivi: /execute align <axes> ….

Chi può usare /execute?

Trucchi attivi o operatore di livello 2.

Comandi correlati