gamerule show_death_messages false

execute if entity @s[tag=gz_bullet_0] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_0] run function thepa:projectiles/hit/entity/bullet_0
execute if entity @s[tag=gz_bullet_1] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_1] run function thepa:projectiles/hit/entity/bullet_1
execute if entity @s[tag=gz_bullet_2] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_2] run function thepa:projectiles/hit/entity/bullet_2
execute if entity @s[tag=gz_bullet_5] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_5] run function thepa:projectiles/hit/entity/bullet_5
execute if entity @s[tag=gz_bullet_6] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_6] run function thepa:projectiles/hit/entity/bullet_6
execute if entity @s[tag=gz_bullet_7] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_7] run function thepa:projectiles/hit/entity/bullet_7
execute if entity @s[tag=gz_bullet_8] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_8] run function thepa:projectiles/hit/entity/bullet_8
execute if entity @s[tag=gz_bullet_9] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_9] run function thepa:projectiles/hit/entity/bullet_9
execute if entity @s[tag=gz_bullet_10] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_10] run function thepa:projectiles/hit/entity/bullet_10
execute if entity @s[tag=gz_bullet_11] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_11] run function thepa:projectiles/hit/entity/bullet_11
execute if entity @s[tag=gz_bullet_12] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_12] run function thepa:projectiles/hit/entity/bullet_12
execute if entity @s[tag=gz_bullet_13] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_13] run function thepa:projectiles/hit/entity/bullet_13
execute if entity @s[tag=gz_bullet_14] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_14] run function thepa:projectiles/hit/entity/bullet_14
execute if entity @s[tag=gz_bullet_15] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_15] run function thepa:projectiles/hit/entity/bullet_15
execute if entity @s[tag=gz_bullet_16] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_16] run function thepa:projectiles/hit/entity/bullet_16
execute if entity @s[tag=gz_bullet_17] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_17] run function thepa:projectiles/hit/entity/bullet_17
execute if entity @s[tag=gz_bullet_18] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_18] run function thepa:projectiles/hit/entity/bullet_18
execute if entity @s[tag=gz_bullet_19] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_19] run function thepa:projectiles/hit/entity/bullet_19
execute if entity @s[tag=gz_bullet_20] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_20] run function thepa:projectiles/hit/entity/bullet_20
execute if entity @s[tag=gz_bullet_21] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_21] run function thepa:projectiles/hit/entity/bullet_21
execute if entity @s[tag=gz_bullet_22] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_22] run function thepa:projectiles/hit/entity/bullet_22
execute if entity @s[tag=gz_bullet_22_s] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_22_s] run function thepa:projectiles/hit/entity/bullet_22_s
execute if entity @s[tag=gz_bullet_23] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_23] run function thepa:projectiles/hit/entity/bullet_23
execute if entity @s[tag=gz_bullet_24] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_24] run function thepa:projectiles/hit/entity/bullet_24
execute if entity @s[tag=gz_bullet_25] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_25] run function thepa:projectiles/hit/entity/bullet_25
execute if entity @s[tag=gz_bullet_26] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_26] run function thepa:projectiles/hit/entity/bullet_26
execute if entity @s[tag=gz_bullet_27] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_27] run function thepa:projectiles/hit/entity/bullet_27
execute if entity @s[tag=gz_bullet_30] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_30] run function thepa:projectiles/hit/entity/bullet_30
execute if entity @s[tag=gz_bullet_35] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_35] run function thepa:projectiles/hit/entity/bullet_35
execute if entity @s[tag=gz_bullet_36] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_36] run function thepa:projectiles/hit/entity/bullet_36
execute if entity @s[tag=gz_bullet_47] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_47] run function thepa:projectiles/hit/entity/bullet_47
execute if entity @s[tag=gz_bullet_48] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_48] run function thepa:projectiles/hit/entity/bullet_48
execute if entity @s[tag=gz_bullet_50] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_50] run function thepa:projectiles/hit/entity/bullet_50
execute if entity @s[tag=gz_bullet_53] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_53] run function thepa:projectiles/hit/entity/bullet_53
execute if entity @s[tag=gz_bullet_54] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_54] run function thepa:projectiles/hit/entity/bullet_54
execute if entity @s[tag=gz_bullet_55] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_55] run function thepa:projectiles/hit/entity/bullet_55
execute if entity @s[tag=gz_bullet_56] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_56] run function thepa:projectiles/hit/entity/bullet_56
execute if entity @s[tag=gz_bullet_57] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_57] run function thepa:projectiles/hit/entity/bullet_57
execute if entity @s[tag=gz_bullet_58] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_58] run function thepa:projectiles/hit/entity/bullet_58
execute if entity @s[tag=gz_bullet_59] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_59] run function thepa:projectiles/hit/entity/bullet_59
execute if entity @s[tag=gz_bullet_60] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_60] run function thepa:projectiles/hit/entity/bullet_60
execute if entity @s[tag=gz_bullet_61] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_61] run function thepa:projectiles/hit/entity/bullet_61
execute if entity @s[tag=gz_bullet_61_hot] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_61_hot] run function thepa:projectiles/hit/entity/bullet_61_hot
execute if entity @s[tag=gz_bullet_62] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_62] run function thepa:projectiles/hit/entity/bullet_62
execute if entity @s[tag=gz_bullet_63] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_63] run function thepa:projectiles/hit/entity/bullet_63
execute if entity @s[tag=gz_bullet_99] at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_99] run function thepa:projectiles/hit/entity/bullet_99

execute at @n[type=!#thepa:unaffected] as @s[tag=!gz_bullet_5] as @e[type=!area_effect_cloud] if score @s killCredit = @n[type=area_effect_cloud,tag=gz_projectile,distance=..5] killCredit if score @n[type=!#thepa:unaffected,distance=0] deathCount matches 1.. run tellraw @a [{"selector":"@n[type=!#thepa:unaffected,distance=0]"}," was shot by ",{"selector":"@s"}," using ",{"selector":"@n[type=area_effect_cloud,tag=gz_projectile,distance=..5]"}]

execute at @n[type=!#thepa:unaffected] as @s[tag=gz_bullet_5] as @e[type=!area_effect_cloud] if score @s killCredit = @n[type=area_effect_cloud,tag=gz_projectile,distance=..5] killCredit if score @n[type=!#thepa:unaffected,distance=0] deathCount matches 1.. run tellraw @a [{"selector":"@n[type=!#thepa:unaffected,distance=0]"}," was pulsed away by ",{"selector":"@s"}," using ",{"selector":"@n[type=area_effect_cloud,tag=gz_projectile,distance=..5]"}]

scoreboard players reset @a[scores={deathCount=1..}] deathCount


gamerule show_death_messages true


execute unless entity @s[tag=gz_SNIPER] run kill @s