execute as @e[type=minecraft:armor_stand,name=DayQ] run execute as @s store result score @s KyuTime run time query daytime





execute unless entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"SC\""]}}}}] run execute unless entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"OSK\""]}}}}] run tellraw @a[tag=K] ["",{"text":"A random event has occured!","color":"yellow","italic":true}]
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"CB\""]}}}}] run function zzzzdonotuse:randomevent/creeperboom
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"SP\""]}}}}] run function zzzzdonotuse:randomevent/skeletonpunch
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"BL\""]}}}}] run function zzzzdonotuse:randomevent/badluck
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"QB\""]}}}}] run function zzzzdonotuse:randomevent/zombiekill
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"HL\""]}}}}] run function zzzzdonotuse:randomevent/hasteluck
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"CI\""]}}}}] run function zzzzdonotuse:randomevent/creeperinvisevent
execute if entity @e[distance=..10,nbt={Item:{tag:{display:{Lore:["\"AP\""]}}}}] run function zzzzdonotuse:randomevent/apples
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"SC\""]}}}}] run function zzzzdonotuse:randomevent/spidercreep
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"QB2\""]}}}}] run function zzzzdonotuse:randomevent/sinkholes
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"SG\""]}}}}] run function zzzzdonotuse:randomevent/skeletongear
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"ZG\""]}}}}] run function zzzzdonotuse:randomevent/zombiegear
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"BBQ\""]}}}}] run function zzzzdonotuse:randomevent/barbecue
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"QMS\""]}}}}] run function zzzzdonotuse:randomevent/meteorstorm/meteorstorm
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"FQ\""]}}}}] run function zzzzdonotuse:randomevent/famine
execute if entity @e[type=item,distance=..7,nbt={Item:{tag:{display:{Lore:["\"SHOS\""]}}}}] run function zzzzdonotuse:randomevent/shootingstar/shootingstarstart
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"PD\""]}}}}] run function zzzzdonotuse:randomevent/pigdeath
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"WH\""]}}}}] run function zzzzdonotuse:randomevent/witchinghour
#execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"QF\""]}}}}] run function zzzzdonotuse:randomevent/
execute if entity @e[distance=..7,nbt={Item:{tag:{display:{Lore:["\"QD\""]}}}}] run function zzzzdonotuse:randomevent/darkness
execute if entity @s[tag=!NoGriefer] run execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"GZ\""]}}}}] run function zzzzdonotuse:randomevent/grieferzombie
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"LAVD\""]}}}}] run function zzzzdonotuse:randomevent/lavadungeon
execute if entity @e[type=minecraft:armor_stand,name=DayQ,scores={KyuTime=500..10000}] run execute unless entity @e[type=minecraft:armor_stand,name=DayQ,scores={NightQ=1..}] run execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"NIQ\""]}}}}] run function zzzzdonotuse:randomevent/eternalnightstart
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"BTG\""]}}}}] run function zzzzdonotuse:randomevent/blesstheground
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"BTTNT\""]}}}}] run function zzzzdonotuse:randomevent/nethercrackle
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"SQ\""]}}}}] run function zzzzdonotuse:randomevent/spookytime
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"CSQ\""]}}}}] run function zzzzdonotuse:randomevent/clearskies
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"CCS\""]}}}}] run function zzzzdonotuse:randomevent/cavespidercreepers
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"STW\""]}}}}] run function zzzzdonotuse:randomevent/woofwoof
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"SPSP\""]}}}}] run function zzzzdonotuse:randomevent/spiderpig
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"OSK\""]}}}}] run function zzzzdonotuse:randomevent/spiderden
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"HELL\""]}}}}] run function zzzzdonotuse:randomevent/hellfirestart
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"EE\""]}}}}] run function zzzzdonotuse:randomevent/voidcalls
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"EIT\""]}}}}] run function zzzzdonotuse:randomevent/everythingisterrible
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"CC\""]}}}}] run function zzzzdonotuse:randomevent/copycat
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"SFE\""]}}}}] run function zzzzdonotuse:randomevent/silverfishy
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"ZPSH\""]}}}}] run function zzzzdonotuse:randomevent/superhostile

#events for structure update part 1
##note: loot table air value increased by 25% after adding these, to make sure they don't happen too often
##note: loot table air value increased by 25% AGAIN after adding these, to make sure they don't happen too often

execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"YW\""]}}}}] run execute if predicate suhc:10percent run function zzzzdonotuse:randomevent/whatcanisayexceptyourewelcome
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"EIT2\""]}}}}] run function zzzzdonotuse:randomevent/everythingisterrible2
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"FS\""]}}}}] run function zzzzdonotuse:randomevent/funsized
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"PA\""]}}}}] run function zzzzdonotuse:randomevent/pantsattack
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"MM\""]}}}}] run function zzzzdonotuse:randomevent/magnetmania/magnetmaniastart
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"JOC\""]}}}}] run function zzzzdonotuse:randomevent/jockey/jockey
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"LL\""]}}}}] run function zzzzdonotuse:randomevent/lanterns/lanternsstart
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"TS\""]}}}}] run function zzzzdonotuse:randomevent/thunderstruck/thunderstruckstart
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"YOMAMA\""]}}}}] run function zzzzdonotuse:randomevent/hottothetouch/hottothetouchstart
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"MOW\""]}}}}] run function zzzzdonotuse:randomevent/mealsonwheels/mealsonwheelsstart
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"SL\""]}}}}] run function zzzzdonotuse:randomevent/superlucky/superluckystart
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"PARA\""]}}}}] run function zzzzdonotuse:randomevent/paratroopers/paratroopersstart
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"GH\""]}}}}] run function zzzzdonotuse:randomevent/glitchinghour/glitchinghourstart
execute if entity @e[distance=..12,nbt={Item:{tag:{display:{Lore:["\"CACK\""]}}}}] run function zzzzdonotuse:randomevent/cacklingcreepers/cacklingcreepersstart