как использовать команду execute в майнкрафт

[Гайд] Команда /execute и её возможности

Итак, в снапшотах версии 1.8 было добавлено очень много команд, упрощающих создание карт на прохождение. К этим командам относится и /execute. Она предназначена для выполнения команд относительно какой-либо сущности. Давайте для начала рассмотрим синтаксис самой команды.

Итак, команда, указываемая в самом конце выполняется относительно выбранной сущности. Иными словами, интерпретатор принимает за стартовую точку отсчёта (x=0, y=0, z=0) координаты выбранного объекта. Указывая координаты, мы смещаем выбранную точку.

Рассмотрим на примере: Команда /execute @p[r=5]

minecraft:stone выберет ближайшего игрока в радиусе пяти блоков, и примет за начало отсчёта его координаты (Например: x=6, y=3, z=4), сместит их на указанное количество блоков (В указанном ранее примере финальными будут координаты: x=10, y=4, z=11), и выполнит команду /setblock

minecraft:stone, установив камень в выбранном по изложенному ранее алгоритму месте.

Также, не стоит забывать, что команда /execute была добавлена в версии 1.8 (Снапшоты).

Источник

[1.8+][Guide] Как пользоваться командой /execute

Начём с того, как пишется команда /execute.
Пример: /execute <Селектор или ник>

Т.е. относительно того, кого мы указали в селекторе будет выполнятся какая-либо команда.

Т.е. относительно всех игроков спавнятся частицы пламени, и вот получается такой эффект.

Также есть такая дополнительная команда, которая действует только для /execute. Это команда detect, которая проверяет есть ли блок в указанном месте.
Пример: /execute <Селектор или ник> <Смещение относительно сущности>detect (Координаты) (id блока) (data блока)

gold_block 0 effect @p 8 1 3

Эта команда делает так, что если вы стоите на золотом блоке, то вам даётся эффект прыжка 4-го уровня (Не 3-го, 4-го).

Также можно писать команду /execute в команде /execute (Да, звучит странно), что позволяет вам искать сущности относительно других сущностей, и уже относительно них выполнять команды.
Пример: /execute <Селектор или ник> <Смещение относительно сущности>execute <селектор>

Т.е. если относительно вас на расстоянии 2 блоков есть крипер, то в него бьёт молния.

Источник

Minecraft Wiki

Из-за новой политики Microsoft в отношении сторонних ресурсов, Minecraft Wiki больше не является официальной. В связи с этим были внесены некоторые изменения, в том числе и обновлён логотип вики-проекта. Подробности на нашем Discord-сервере.

Руководство по команде execute

Execute — команда, позволяющая выполнить другую команду относительно какой-либо сущности. Аргумент detect позволяет выполнить команду только при наличии определённого блока относительно сущности.

Синтаксис [ ]

x, y, z — Координаты, относительно которых будет выполнена команда. Могут быть точными или относительными. Относительные координаты воспринимаются от сущности, а не от места исполнения команды.

x1, y1, z1 — Координаты блока для проверки. Могут быть точными или относительными. Относительные координаты воспринимаются от сущности, а не от места исполнения команды.

Использование [ ]

Поставит под игроком Alexander блок лавы.

Поставит 10 блоков гравия над 5 самыми дальними игроками, которые стоят на траве.

Заспаунит странников Края рядом со всеми скелетами, которые стоят на любом блоке дерева (Учитываются только блоки дерева с идентификатором minecraft: log — это дуб, береза, ель и тропическое дерево).

Данная команда установит блок красного камня над угольным блоком, если найдет стойку для брони с именем «structure», причем под этой стойкой должен быть алмазный блок, над стойкой — блок железа, а над ним блок угля.

Источник

Minecraft Wiki

The Minecraft Wiki is no longer considered as official by Microsoft and therefore several changes are required to be made, including to the wiki’s logo. Please read this announcement for more information.

Commands/execute

/execute executes another command but allows changing the executor, changing the position and angle it is executed at, adding preconditions, and storing its result.

Contents

Java Edition [ ]

In Java Edition, there are twelve instructions (or sub-commands) for the /execute command. Multiple sub-commands are connected after /execute. Subcommands are divided into 4 categories: modify subcommands, condition subcommands, store subcommands, and run subcommand.

All needed sub-commands can be concatenated together. Subcommands other than the run subcommand can be arranged arbitrarily and used multiple times. But the run subcommand can only be used once and must be put at the end of the subcommands chain. A run subcommand or a condition subcommand finalizes the command, otherwise the command does nothing. The game processes these subcommands in order from front to end, for example, the following commands are different:

The game processes other subcommands before processing run subcommands, so the run subcommand cannot affect other subcommands. In some cases, the command may terminate halfway and does nothing.

Читайте также:  bullguard internet security 2021 код активации

After executed (if it does not terminate halfway), the command returns a success value and a result value (see #Store subcommand for details). These two values ​​come from the last subcommand (may be a condition subcommand or a run subcommand). Note that the return value of the command must be an integer, if not, it is rounded down. The success value is always 0 or 1. When the command fails, both return values ​​are 0. The two values can be stored by store subcommands. When the last subcommand (may be a condition subcommand or a run subcommand) is executed multiple times, return values of each will be stored after each execution.

There are twelve instructions (or sub-commands) for the /execute command, and each has its own special syntax, so describing syntax takes a large branching tree.

Источник

How to Use the Execute Command in Minecraft

This Minecraft tutorial explains how to use the /execute command with screenshots and step-by-step instructions.

The /execute command is one of most complex commands in Minecraft. In most cases, you will chain multiple /execute commands together making the command a bit more difficult to understand. Let’s explore how to use this cheat (game command).

Supported Platforms

The /execute command is available in the following versions of Minecraft:

Platform Supported (Version*)
Java Edition (PC/Mac) Yes (1.8)
Pocket Edition (PE) Yes (0.16.0)
Xbox 360 No
Xbox One Yes (1.2)
PS3 No
PS4 Yes (1.14.0)
Wii U No
Nintendo Switch Yes (1.5.0)
Windows 10 Edition Yes (0.16.0)
Education Edition Yes

* The version that it was added or removed, if applicable.
NOTE: Pocket Edition (PE), Xbox One, PS4, Nintendo Switch, and Windows 10 Edition are now called Bedrock Edition. We will continue to show them individually for version history.

Requirements

To run game commands in Minecraft, you have to turn cheats on in your world.

Execute Command

Execute Command in Minecraft Java Edition (PC/Mac)

In Minecraft Java Edition (PC/Mac) 1.14, 1.15 and 1.16, there are different syntaxes for the /execute command.

To align the block grid based on the specified axes and then run a second /execute command based on the aligned position:

To anchor the local coordinate origin to either the eyes or the feet of the entity running the command and then run a second /execute command:

To run a second /execute command on behalf of an entity:

To run a second /execute command using the position, dimension (ie: Overworld, Nether, End) and rotation of the target entity (without changing the entity that is running the command):

To run a second /execute command that uses an execution point that faces the target entity’s eyes or feet:

To run a second /execute command that uses an execution point that faces a specific coordinate:

To run a second /execute command if a block at specified coordinate matches the given Minecraft ID name:

To run a second /execute command if the blocks in the region from to matches the :

To run a second /execute command if a block at a specific coordinate has data for the NBT tag specified by

To run a second /execute command if a targeted entity has data for the NBT tag specified by

To run a second /execute command if a targeted entity exists:

To run a second /execute command if a targeted entity has a score (for a targeted objective) that matches a range:

To run a second /execute command if a targeted entity has a score (for a targeted objective) that meets a criteria when comparing to a source objective. The comparison of the two objectives can be based on: less than ( ), or greater than equals (>=) :

To run a second /execute command as if the entity running the command is in the specified dimension:

To run a second /execute command using the target’s position as the current position:

To run a second /execute command using a specified coordinate as the current position:

To run a second /execute command using the rotation of the target:

To store the result/success of a second /execute command in a block at a specified coordinate:

Читайте также:  евген бро в лего майнкрафте

To store the result/success of a second /execute command in a bossbar:

To store the result/success of a second /execute command in a target entity’s NBT tag as specified by

To store the result/success of a second /execute command in the score of a target entity’s objective:

To store the result/success of a second /execute command in the score of a target entity’s objective:

To run a second /execute command unless a block at specified coordinate matches the given Minecraft ID name:

To run a second /execute command unless the blocks in the region from to matches the :

To run a second /execute command unless a block at a specific coordinate has data for the NBT tag specified by

To run a second /execute command unless a targeted entity has data for the NBT tag specified by

To run a second /execute command unless a targeted entity exists:

To run a second /execute command unless a targeted entity has a score (for a targeted objective) that matches a range:

To run a second /execute command unless a targeted entity has a score (for a targeted objective) that meets a criteria when comparing to a source objective. The comparison of the two objectives can be based on: less than ( ), or greater than equals (>=) :

In Minecraft Java Edition (PC/Mac) 1.11 and 1.12, there are 2 syntaxes for the /execute command.

To execute a command on behalf of an entity:

To execute a command on behalf of the entity, only if a specific block is detected at :

Definitions

Execute Command in Minecraft Pocket Edition (PE)

In Minecraft Pocket Edition (PE), there are 2 syntaxes for the /execute command.

To execute a command on behalf of an entity:

To execute a command on behalf of the entity, only if a specific block is detected at :

Definitions

Execute Command in Minecraft Xbox One Edition

In Minecraft Xbox One Edition, there are 2 syntaxes for the /execute command.

To execute a command on behalf of an entity:

To execute a command on behalf of the entity, only if a specific block is detected at :

Definitions

Execute Command in Minecraft PS4 Edition

In Minecraft PS4 Edition, there are 2 syntaxes for the /execute command.

To execute a command on behalf of an entity:

To execute a command on behalf of the entity, only if a specific block is detected at :

Definitions

Execute Command in Minecraft Nintendo Switch Edition

In Minecraft Nintendo Switch Edition, there are 2 syntaxes for the /execute command.

To execute a command on behalf of an entity:

To execute a command on behalf of the entity, only if a specific block is detected at :

Definitions

Execute Command in Minecraft Windows 10 Edition

In Minecraft Windows 10 Edition, there are 2 syntaxes for the /execute command.

To execute a command on behalf of an entity:

To execute a command on behalf of the entity, only if a specific block is detected at :

Definitions

Execute Command in Minecraft Education Edition

In Minecraft Education Edition, there are 2 syntaxes for the /execute command.

To execute a command on behalf of an entity:

To execute a command on behalf of the entity, only if a specific block is detected at :

Definitions

Examples

Example in Java Edition (PC/Mac) 1.14, 1.15 and 1.16

To first align the current xyz position in the block grid and then summon a cat if the entity running the command is within 5 blocks of the coordinate (229,70,92):

To anchor to eye level and then display the flame particle that is 1 block in front of the entity executing the command:

To give all players 8 golden apples:

To summon a lightning bolt at all creepers:

To teleport all players to the coordinates (8, 64, 22):

Example in Java Edition (PC/Mac) 1.11 and 1.12

To give a golden apple to all players in Java Edition (PC/Mac) 1.11 and 1.12:

To give 64 golden apples to all players:

To teleport all players to the coordinates (8, 64, 22):

To summon a lightning bolt at all creepers:

Example in Java Edition (PC/Mac) 1.10

To summon a lightning bolt at all creepers in Java Edition (PC/Mac) 1.10:

Example in Pocket Edition (PE)

To give an enchanted golden apple to all players in Minecraft PE:

To give 64 enchanted golden apples to all players:

Читайте также:  команда просмотра сетевых настроек windows

To teleport all players to the coordinates (8, 64, 22):

Example in Xbox One Edition

To give an iron sword to all players in Minecraft Xbox One Edition:

To give 3 coal blocks to all players:

To teleport all players to the coordinates (-1, 62, 80):

Example in PS4 Edition

To give a trident to all players in Minecraft PS4 Edition:

To give 64 golden apples to all players:

Example in Nintendo Switch Edition

To give a fishing rod to all players in Minecraft Nintendo Switch Edition:

To give 64 golden apples to all players:

Example in Windows 10 Edition

To give a diamond sword to all players in Windows 10 Edition:

To give 5 diamond swords to all players:

To teleport all players to the coordinates (12, 65, 34):

Example in Education Edition

To give a golden apple to all players in Minecraft Education Edition:

To give 64 golden apples to all players:

To teleport all players to the coordinates (20, 65, 32):

How to Enter the Command

1. Open the Chat Window

The easiest way to run a command in Minecraft is within the chat window. The game control to open the chat window depends on the version of Minecraft:

2. Type the Command

We will cover examples of how to use the /execute command that chain multiple execute commands together.

Summon a Cat if within 5 blocks of a Specific Coordinate

In this example, we are going to first align the current xyz position in the block grid and then summon a cat if the entity running the command is within 5 blocks of the coordinate (229,70,92) with the following command:

Type the command in the chat window. As you are typing, you will see the command appear in the lower left corner of the game window. Press the Enter key to run the command.

Once the cheat has been entered, the cat will be summoned ONLY IF you are within 5 blocks of the xyz coordinate (229,70,92).

You will see the message » Summoned new Cat » appear in the lower left corner to indicate that the summon was successfully summoned. If the player was NOT within 5 blocks of the coordinate (229,70,92), the /execute command would do nothing and NOT summon a cat.

Display a Particle directly in front of an Entity at Eye Level

In this example, we are going to anchor to eye level and then display the flame particle that is 1 block in front of the entity executing the command with the following command:

Type the command in the chat window and press the Enter key to run the command.

Once the cheat has been entered, the flame particle will appear directly 1 block in front of the entity running the command.

You will see the message » Displaying particle minecraft:flame » appear in the lower left corner of the game window to indicate that the flame particle has been displayed. With this command, no matter where the entity is looking, the flame particle will appear directly in front of the entity at eye-level.

Give all players 8 Golden Apples

In this example, we are going to give all players 8 golden apples with the following command:

Type the command in the chat window and press the Enter key to run the command.

Once the cheat has been entered, 8 golden apples will be given to each player.

You will see the message » Gave 8 [Golden Apple] to DigMinecraft » appear in the lower left corner of the game window to indicate that the golden apples were given to the players. Since we are running the /execute command on behalf of @a, all players will be given 8 golden apples.

As you can see, the possibilities for the /execute command are endless. Give it a try and see what amazing commands you can create.

Congratulations, you have learned how to use the /execute command in Minecraft.

Other Game Commands

You can use other commands and cheats in Minecraft such as:

Источник

Компьютерный онлайн портал