command /execute

Datapacks and command blocks

Executes another command on behalf of an entity, at its point or condition. Main command of command blocks and datapacks.

  • rights - game master
  • Minecraft 26.3
My game select version

We'll remember in this browser and set up where your version is available. Open link settings are more important than this choice; the Vicki versions do not change.

On page 6 sections

Briefly

Examples are verified by the game - copy

  • Lightning Bolt at every player
    /execute as @a at @s run summon minecraft:lightning_bolt
  • Say if you're standing on the grass
    /execute if block ~ ~-1 ~ minecraft:grass_block run say На траве
  • Gold under the nearest player
    /execute at @p run setblock ~ ~-1 ~ minecraft:gold_block

Rights - game master.

Syntax

This is how the game itself shows it /help execute: in angle brackets - what to substitute, in square brackets - optional, through a line - one of.

  • /execute run ...
  • /execute if (block|biome|loaded|dimension|score|blocks|entity|predicate|function|stopwatch|data|items|slots)
  • /execute unless (block|biome|loaded|dimension|score|blocks|entity|predicate|function|stopwatch|data|items|slots)
  • /execute as <targets> -> execute
  • /execute at <targets> -> execute
  • /execute store (result|success)
  • /execute positioned (<pos>|as|over)
  • /execute rotated (<rot>|as)
  • /execute facing (entity|<pos>)
  • /execute align <axes> -> execute
  • /execute anchored <anchor> -> execute
  • /execute in <dimension> -> execute
  • /execute summon <entity> -> execute
  • /execute on (owner|leasher|target|attacker|vehicle|controller|origin|passengers)

Rights

We need a game master level: Level 2 for the command unit, for the data pack functions and for the guests of the world open to the network with authorized commands. It's written in server consoles without a cross-section.

Numbers

WhatMeaning
command/execute
RightsPlaymaster (2)
Where ison the server and in single player with cheats
Subcommandsalign, anchored, as, at, facing, if, in, on, positioned, rotated, run, store, summon, unless

Frequently asked questions

How to use command / execute?

Syntax: /execute run .... For example, /execute as @a at @s run summon minor:lightning_bolt is the Lightning Bolt of each player.

What rights are needed for /execute?

We need a game master level: Level 2 for the command unit, for the data pack functions and for the guests of the world open to the network with authorized commands.

Does the command block work?

Yeah, the command unit's doing right-level 2 commands, and this one doesn't need any more. You don't have to write a line in the block.

Also, date packs and command blocks.

According to Minecraft 26.3, the syntax is a clue to /help from the game itself, right from her command report, each example is checked by a review of the game's commands.