minerace/data/emk/functions/kart/item/lightning.mcfunction

5 lines
382 B
Mcfunction

scoreboard players operation #tmp emk-id = @s emk-place
execute at @e[tag=emk-map,distance=..500,limit=1] as @e[tag=emk-kart,distance=..500] if score @s emk-place < #tmp emk-id at @s run function emk:kart/lightning
playsound minecraft:entity.lightning_bolt.thunder ambient @a ~ ~ ~ 20
scoreboard players set @s emk-item 0
replaceitem entity @p[tag=emk-sel] container.2 minecraft:air