Что такое триггер в майнкрафт

Во второй части я расскажу вам про 2 параметр команды /scoreboard — «players», а также немного о команде/trigger и её особенностях.

Данный параметр имеет свои значения: set , add, list, remove, reset, tag, test, operation, enable.

Давайте создадим событие: /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

2. Add — прибавляет очки к заданной цели.

/scoreboard players add * KB 5

Как видим, всем игрокам в таблице прибавилось 5 очков.

3. Remove — отнимает некоторое кол-во очков от события.

/scoreboard players remove * KB 10

4. Reset — сбрасывает весь счёт очков.

/scoreboard players reset @e KB

Если мы не укажем в каком событии нам нужно сбросить очки, т.е.

/scoreboard players reset @e

Сбросятся очки во всехсобытиях.

Чуть не забыл, также можно начислять, добавлять, отнимать и сбрасывать очки у всех сущностей и предметов.

Для этого в селекторе нужно указать тип сущности : @e[type=(Arrow, Snowball,Item..)]

5. list — отображает все события и их счёт у указанной сущности.

/scoreboard players list [сущность]

6. tag — Добавляет/ удаляет тег для сущности.

/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.

7. test — тестирует какое-либо событие.

Создади событие Test c типом dummy

Пропишем в цикличный кб команду и поставим компаратор на выходе: scoreboard players test @p Test 4 10

Данная команда будет тестировать нас в событии Test, если у нас минимум 4 очка и максимум 10 очков.

Как видим при 4 очках компаратор выдаёт сигнал. Если мы поставим 3 или 11, сигнала не будет, так как мы поставили диапазон от 4 до 10.

8. Operation — проводит математические операции с событиями игроков.

Предположим, что у нас есть событие Test с двумя игроками(один из них — фиктивный), выведенных на экран.

В этом событии у меня 12 очков, у фиктивного игрока- 6

Синтаксис: /scoreboard players operation

%= — остаток от деления

= — присваивание (устанавливает счёт первого игрока на счёт второго).

— если счёт первого игрока больше счета второго, то устанавливается счет второго на счёт первого. Т.е. они выравниваются.

Add — добавляет некоторое количество очков исполнителю в событии.

Set — устанавливает необходимое количество очков исполнителю в событии.

/trigger Trig set 6

После использования данной команды она отключается.

Итак, в данном уроке мы с вами разобрали вторую часть команды /scoreboard — players. Надеюсь данный урок вам понравился. Если у вас остались вопросы, смело задавайте их в комментариях.

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).

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

Platform Supported (Version*)

Java Edition (PC/Mac)
Yes (1.8)

Pocket Edition (PE)
No

Xbox 360
No

Xbox One
No

PS3
No

PS4
No

Wii U
No

Nintendo Switch
No

Windows 10 Edition
No

Education Edition
No

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

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

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:

  • objective is the name of the objective that will be set or add a value to.
  • setValue is the value to set the objective to.
  • addValue is the amount added to the objective.

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:

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:

  • For Java Edition (PC/Mac), press the T key to open the chat window.

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!

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

How do I use /trigger?

I’ve created an objective «Buy» type trigger, but when I do /trigger Buy set 1, it says «Invalid trigger name Buy»

  • Full Stack
  • Join Date: 7/6/2011
  • Posts: 7,603
  • Member Details

I’ve created an objective «Buy» type trigger, but when I do /trigger Buy set 1, it says «Invalid trigger name Buy»

You will have to ‘enable’ the objective for the target player first:

When their objective value is changed, the trigger will be disabled again.

1 Звезда2 Звезды3 Звезды4 Звезды5 Звезд (Пока оценок нет)
Загрузка...
Adblock
detector