что делает команда trigger в майнкрафт
Урок 14 — команда /scoreboard Part 2 и команда /trigger.
Давайте создадим событие: /scoreboard objectives add KB dummy
Выведем его на экран: /scoreboard objectives setdisplay sidebar KB
Параметр set начисляет некоторое кол-во очков в наше событие.
Давайте попробуем начислить всем игрокам 50 очков в событие КВ:
/scoreboard players set @a KB 50
Чтобы начислить очки всем всем игрокам(даже фиктивным т.е. несуществующим), нужно вместо @a поставить *.
Теперь начислим несуществующему игроку 10 очков.
/scoreboard players set Фиктивный KB 10
/scoreboard players add * KB 5
Как видим, всем игрокам в таблице прибавилось 5 очков.
/scoreboard players remove * KB 10
/scoreboard players reset @e KB
Если мы не укажем в каком событии нам нужно сбросить очки, т.е.
/scoreboard players reset @e
Сбросятся очки во всехсобытиях.
Чуть не забыл, также можно начислять, добавлять, отнимать и сбрасывать очки у всех сущностей и предметов.
Для этого в селекторе нужно указать тип сущности : @e[type=(Arrow, Snowball,Item..)]
/scoreboard players list [сущность]
/scoreboard players tag add [тег данных]
/scoreboard players tag @e[type=Arrow] add Expl
Мы добавили всем стрелам тег Expl
Теперь выстрелим несколько раз и проверим:
/scoreboard players tag @e[type=Arrow] list
И видим, тег дался каждой стреле.
Чтобы убрать тег, пропишем команду:
/scoreboard players tag @e[type=Arrow] remove Expl
Данный параметр активен только до версии 1.12.2. Уже с версии 1.13 существует специальная команда /tag.
Создади событие Test c типом dummy
Пропишем в цикличный кб команду и поставим компаратор на выходе: scoreboard players test @p Test 4 10
Данная команда будет тестировать нас в событии Test, если у нас минимум 4 очка и максимум 10 очков.
Как видим при 4 очках компаратор выдаёт сигнал. Если мы поставим 3 или 11, сигнала не будет, так как мы поставили диапазон от 4 до 10.
Предположим, что у нас есть событие Test с двумя игроками(один из них — фиктивный), выведенных на экран.
В этом событии у меня 12 очков, у фиктивного игрока- 6
Синтаксис: /scoreboard players operation
— если счёт первого игрока больше счета второго, то устанавливается счет второго на счёт первого. Т.е. они выравниваются.
Add — добавляет некоторое количество очков исполнителю в событии.
Set — устанавливает необходимое количество очков исполнителю в событии.
/trigger Trig set 6
После использования данной команды она отключается.
Итак, в данном уроке мы с вами разобрали вторую часть команды /scoreboard — players. Надеюсь данный урок вам понравился. Если у вас остались вопросы, смело задавайте их в комментариях.
How to Use the Trigger Command in Minecraft
This Minecraft tutorial explains how to use the /trigger command with screenshots and step-by-step instructions.
You can use the /trigger command to create a trigger that sets or adds values to scoreboard objectives that trigger enabled in Minecraft. Let’s explore how to use this cheat (game command).
Supported Platforms
The /trigger command is available in the following versions of Minecraft:
Platform | Supported (Version*) |
---|---|
| Yes (1.8) |
| No |
| No |
| No |
| No |
| No |
| No |
| No |
| No |
| No |
* 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
There are no requirements for the /trigger command. Even if you have cheats turned off, you can still run the /trigger command.
Trigger Command
Trigger Command in Minecraft Java Edition (PC/Mac)
In Minecraft Java Edition (PC/Mac), there are different syntaxes depending on what you would like to do with the trigger.
To create a trigger that sets the value of a scoreboard objective:
To create a trigger that adds a value to the current value of the scoreboard objective:
Definitions
Examples
Example in Java Edition (PC/Mac)
To create a trigger that adds a value of 1 to the scoreboard objective called FirstObjective:
To create a trigger that sets the scoreboard objective called SecondObjective to 25:
TIP: Before running these /trigger command examples, you will need to use to the /scoreboard command to first create the scoreboard objectives and then enable them.
To create the objectives:
And then to enable the objective for all players:
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
In this example, we will create a trigger that adds 1 to the scoreboard objective called FirstObjective.
But first, let’s create and enable the trigger objective called FirstObjective with the following /scoreboard commands:
Now, let’s create a trigger that adds 1 to the scoreboard objective called FirstObjective with the following /trigger 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 trigger will be created.
You will see the message » Trigger FirstObjective changed with add 1 » appear in the lower left corner of the game window to indicate that the trigger was successfully configured.
Congratulations, you just learned how to use the /trigger command in Minecraft!
Other Game Commands
You can use other commands and cheats in Minecraft such as: