minerace/data/emk/functions/tick.mcfunction

30 lines
2.0 KiB
Mcfunction

kill @e[type=minecraft:item]
kill @e[type=minecraft:potion]
execute as @a unless score @s emk-id matches 1.. run function emk:player/register
stopsound @a * minecraft:entity.splash_potion.throw
stopsound @a * minecraft:item.armor.equip_generic
#team join kart @a
effect give @a minecraft:saturation 1000000 255 true
effect give @a minecraft:resistance 1000000 255 true
#execute positioned 0.5 50 9.5 run tag @a[distance=..3] add emk-queue
#execute positioned 0.5 50 9.5 run tag @a[distance=3.5..] remove emk-queue
execute positioned 0.5 50 16.5 run tag @a[distance=..8.5] add emk-queue
execute positioned 0.5 50 16.5 run tag @a[distance=9..] remove emk-queue
execute store result score #tmp emk-id if entity @a[tag=emk-queue]
execute if score #tmp emk-id matches ..1 run scoreboard players set #max emk-timer 160
execute if score #tmp emk-id matches 2.. run scoreboard players remove #max emk-timer 1
execute store result bossbar emk:queue value run scoreboard players get #max emk-timer
bossbar set emk:queue name [{"color":"#55bbff","score":{"name":"#tmp","objective":"emk-id"}},{"text":"/8 players in queue"}]
execute if score #tmp emk-id matches 2..7 if score #max emk-timer matches 0 run function emk:race/launch
execute if score #tmp emk-id matches 8 run function emk:race/launch
bossbar set emk:queue players @a[tag=emk-queue]
execute as @e[tag=emk-box] at @s run function emk:box/update
execute as @e[tag=emk-turtle] at @s run function emk:turtle/update
execute as @e[tag=emk-turtle] at @s run function emk:turtle/update
execute as @e[tag=emk-turtle] at @s run function emk:turtle/update
execute as @e[tag=emk-turtle] at @s run function emk:turtle/update
execute as @e[tag=emk-slime] at @s if block ~ ~-.1 ~ #emk:transparent run tp @s ~ ~-.1 ~
execute as @e[tag=emk-kart,tag=!emk-finished] at @s run function emk:kart/update
#execute as @e[tag=emk-seat] at @s run function emk:seat/update
execute as @e[tag=emk-kart] at @s run function emk:kart/place
execute as @e[tag=emk-map] at @s run function emk:race/update