Найти в Дзене
ХомБемчикс

Как сделать таймер в майнкрафте

Таймер прикольная штука, особенно с помощью боссбара. Команды, которые нужно прописать 1 раз. /bossbar add timer {"text":""} /bossbar set minecraft:timer players @a /scoreboard objectives add timer dummy /scoreboard players set 60 timer 60 /scoreboard players set True timer -1 Команды в комадных блоках. В цикличном кб: bossbar set minecraft:timer name [{"text":"Минут: "},{"score":{"name":"minute","objective":"timer"},"color":"gold"},{"text":" Секунд: "},{"score":{"name":"second","objective":"timer"},"color":"gold"}] В последовательных кб: 1. execute if score True timer matches -1 run scoreboard players set True timer 1 2. execute if score True timer matches 1 run scoreboard players operation minute_maths timer = minute timer 3. execute if score True timer matches 1 store result score all_second timer run scoreboard players operation minute_maths timer *= 60 timer 4. execute if score True timer matches 1 run scoreboard players operation all_second timer += second timer 5. execute if sc
Мало времени, очень мало
Мало времени, очень мало

Таймер прикольная штука, особенно с помощью боссбара.

Команды, которые нужно прописать 1 раз.

/bossbar add timer {"text":""}

/bossbar set minecraft:timer players @a

/scoreboard objectives add timer dummy

/scoreboard players set 60 timer 60

/scoreboard players set True timer -1

Команды в комадных блоках.

В цикличном кб: bossbar set minecraft:timer name [{"text":"Минут: "},{"score":{"name":"minute","objective":"timer"},"color":"gold"},{"text":" Секунд: "},{"score":{"name":"second","objective":"timer"},"color":"gold"}]

В последовательных кб:

1. execute if score True timer matches -1 run scoreboard players set True timer 1

2. execute if score True timer matches 1 run scoreboard players operation minute_maths timer = minute timer

3. execute if score True timer matches 1 store result score all_second timer run scoreboard players operation minute_maths timer *= 60 timer

4. execute if score True timer matches 1 run scoreboard players operation all_second timer += second timer

5. execute if score True timer matches 1 store result bossbar minecraft:timer max run scoreboard players get all_second timer

6. execute if score True timer matches 1 store result bossbar minecraft:timer max run scoreboard players get all_second timer

7. execute if score True timer matches 1 run scoreboard players set True timer 0

8. execute if score minute timer matches ..0 if score second timer matches ..0 if score True timer matches 0 run give @a diamond

После окончания таймера, можно сделать любое действие. Я сделал, что всем игрокам выдастся 1 алмаз.

9. execute if score minute timer matches ..0 if score second timer matches ..0 run scoreboard players set True timer -2

10. execute if score True timer matches 0 run scoreboard players remove tick timer 1

11. execute if score True timer matches 0 if score tick timer matches ..0 run scoreboard players remove all_second timer 1

12. execute if score True timer matches 0 if score tick timer matches ..0 run scoreboard players remove second timer 1

13. execute if score True timer matches 0 if score tick timer matches ..0 run scoreboard players set tick timer 20

14. execute if score True timer matches 0 if score second timer matches ..0 unless score minute timer matches 0 run scoreboard players remove minute timer 1

15. execute if score True timer matches 0 if score second timer matches ..0 unless score minute timer matches 0 run scoreboard players set second timer 60

16. execute if score True timer matches 0 store result bossbar minecraft:timer value run scoreboard players get all_second timer

Чтобы задать значения для таймера, пропишите команды.

/scoreboard players set minute timer ваше число минут

/scoreboard players set second timer ваше число секунд

Когда таймер закончится, задайте новые значения для минут и секунд и пропишите команду .

/scoreboard players set True timer -1