execute as @e[type=item_display,tag=svm_ep.block,tag=!svm_ep.block_set] at @s run function svm_ep:block/set

scoreboard players remove @e[scores={svm_ep.using_move=1..}] svm_ep.using_move 1

tag @e[type=#minecraft:impact_projectiles,tag=!svm_ep.arrow_redirected] add svm_ep.can_redirect
scoreboard players set @e[type=#minecraft:impact_projectiles] svm_ep.projectile 1


kill @e[tag=rotator]
execute as @e[tag=svm_ep.npc,tag=!svm_ep.npc_display] at @s run function svm_ep:npc/tick
execute as @e[type=#svm_ep:selected,tag=!svm_ep.power_user,tag=!svm_ep.flora_oak_leaves,tag=!svm_ep.npc,tag=!svm_ep.placed_ice] at @s run function svm_ep:selected_tick

#PARTICLE
execute as @e[scores={svm_ep.particle=1..}] run function svm_ep:particle_tick
#PROJECTILE
execute as @e[scores={svm_ep.projectile=-100..}] run function svm_ep:projectile_tick

#POWERS+STYLES
execute as @e[scores={svm_ep.fighting_style=1..}] at @s run function svm_ep:fighting_style/tick
execute as @e[tag=svm_ep.power_user] at @s run function svm_ep:power/user_tick

#PLAYER
execute as @a at @s run function svm_ep:player/tick
execute as @a[scores={svm_ep.menu=1..}] run function svm_ep:menu/trigger


execute as @e[type=interaction,tag=svm_ep.click_check] at @s run function svm_ep:system/click_check/hitbox_tick
execute in svm_ep:void as @e[distance=0..,type=!#svm_ep:technical] run function svm_ep:power/void/black_hole/effect_tick




#execute as @e[type=slime,tag=svm_ep.slime_summoned] at @s run function svm_ep:power/slime/living/tick

#EFFECTS
execute as @e[scores={svm_ep.effect=1..}] run function svm_ep:entity/effect/tick
execute as @e[scores={svm_ep.p.gravity_punched_normal=1..}] run function svm_ep:power/gravity/punch/punched_normal
execute as @e[scores={svm_ep.p.gravity_punched_reverse=1..}] run function svm_ep:power/gravity/punch/punched_reverse
execute as @e[scores={svm_ep.p.flora_thorned=1..}] run function svm_ep:power/flora/thorned/tick
execute as @e[scores={svm_ep.p.flora_blooming_effect=1..}] run function svm_ep:power/flora/blooming_flash/effect
execute as @e[scores={svm_ep.p.explosion_barrier_effect=1..}] run function svm_ep:power/explosion/barrier/effect
execute as @e[scores={svm_ep.p.fire_on_fire=1..}] run function svm_ep:power/fire/on_fire
scoreboard players remove @e[scores={svm_ep.portal_delay=1..}] svm_ep.portal_delay 1
scoreboard players remove @e[scores={svm_ep.p.dimension_front_delay=1..}] svm_ep.p.dimension_front_delay 1

execute if entity @e[tag=svm_ep.npc_thunder_god] run bossbar set minecraft:lightning_god visible true
execute unless entity @e[tag=svm_ep.npc_thunder_god] run bossbar set minecraft:lightning_god visible false

execute if score %WORLD_SPEED svm_ep.world_settings matches 0.. run function svm_ep:system/world/speeded_up
execute if score %METEOR_RAIN svm_ep.world_settings matches 0.. run function svm_ep:system/world/meteor_rain

#ITEM TICK
execute as @e[type=item] run function svm_ep:item_tick

#LAGGY
execute as @e[tag=svm_ep.explosion_ray,sort=random,limit=50] at @s run function svm_ep:power/explosion/destroyer/projectile_tick
execute as @e[tag=svm_ep.lightning_ready,limit=1,sort=random] at @s run function svm_ep:power/lightning/lightning_place/summon
execute as @e[tag=svm_ep.flora_oak_leaves,limit=26,sort=random] at @s run function svm_ep:power/flora/tree_place/place_leaf2
execute as @e[tag=svm_ep.flora_tree] run function svm_ep:power/flora/tree_place/tick
execute as @e[tag=svm_ep.flora_tree_big] run function svm_ep:power/flora/tree_big/projectile_tick
scoreboard players add @e[type=marker,tag=svm_ep.placed_ice] svm_ep.lifetime 1
execute as @e[type=marker,tag=svm_ep.placed_ice,scores={svm_ep.lifetime=160..},limit=50] at @s run function svm_ep:power/ice/berg/destroy_ice
execute as @e[tag=svm_ep.iceberg_projectile,sort=random,limit=25] at @s run function svm_ep:power/ice/berg/projectile_tick


#BLOCK
tag @e[type=item_display,tag=svm_ep.block] remove svm_ep.block_ticked
