#kill @e[name=Meteor]
#execute as @e[type=armor_stand,name=DayQ] run scoreboard players set @s TKQ 0
#kill @e[type=fireball]
#scoreboard players set @e[sort=random,limit=1,type=player,tag=K] TKQ 1
#execute as @e[type=armor_stand,name=DayQ] run scoreboard players set @s EQK 9000
#setblock ~-6 ~-10 ~-2 redstone_block??????????????????????????????
##redstone blocky??????????!?!?!?!?!?!?!?
###????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????




execute if entity @e[type=armor_stand,name=DayQ,tag=HardMode] run execute in overworld run data merge block 999982 122 999980 {auto:1b}
execute if entity @e[type=armor_stand,name=DayQ,tag=HardMode] run execute in overworld run execute unless entity @e[type=marker,tag=MeteorStormEvent] run summon marker 999982 122 999980 {Tags:["MeteorStormEvent"]}
execute if entity @e[type=armor_stand,name=DayQ,tag=HardMode] run execute in overworld run execute if entity @e[type=marker,tag=MeteorStormEvent] run scoreboard players set @e[type=marker,tag=MeteorStormEvent] KyuDummy 0


#set KyuDummy to anywhere from 0-600, making the duration of the meteor storm last from 600-1200 ticks
execute if entity @e[type=armor_stand,name=DayQ,tag=HardMode] run execute in overworld positioned 999982 122 999980 run execute as @e[type=marker,tag=MeteorStormEvent,distance=..3] run execute at @s run execute store result score @s KyuDummy3 run data get entity @s UUID[0] .1
execute if entity @e[type=armor_stand,name=DayQ,tag=HardMode] run execute in overworld positioned 999982 122 999980 run execute as @e[type=marker,tag=MeteorStormEvent,distance=..3] run execute at @s run scoreboard players set @s KyuDummy4 600
execute if entity @e[type=armor_stand,name=DayQ,tag=HardMode] run execute in overworld positioned 999982 122 999980 run execute as @e[type=marker,tag=MeteorStormEvent,distance=..3] run execute at @s run scoreboard players operation @s KyuDummy3 %= @s KyuDummy4
execute if entity @e[type=armor_stand,name=DayQ,tag=HardMode] run execute in overworld positioned 999982 122 999980 run execute as @e[type=marker,tag=MeteorStormEvent,distance=..3] run execute at @s run scoreboard players operation @s KyuDummy = @s KyuDummy3


execute if entity @e[type=armor_stand,name=DayQ,tag=HardMode] run tellraw @a[team=P] ["",{"text":"A meteor storm is incoming!","color":"dark_red","italic":true}]
execute if entity @e[type=armor_stand,name=DayQ,tag=HardMode] run tellraw @a[team=P] ["",{"text":"NOTE: Items will periodically be deleted during this time to reduce lag - this does not include items dropped by the player on death or items near the player.","color":"dark_gray","italic":true}]