execute at @s run summon arrow ~ ~ ~ {LeftOwner:0b,Tags:["SpecArrRep","DoNotLightning"]}

execute as @s[nbt={custom_potion_effects:[{id:"minecraft:hero_of_the_village",amplifier:100b}]}] run function zzzzdonotuse:weapons/ironarrowcrossbow
execute as @s[nbt={custom_potion_effects:[{id:"minecraft:hero_of_the_village",amplifier:101b}]}] run function zzzzdonotuse:weapons/goldarrowcrossbow
execute as @s[nbt={custom_potion_effects:[{id:"minecraft:hero_of_the_village",amplifier:102b}]}] run function zzzzdonotuse:weapons/diamondarrowcrossbow
execute as @s[nbt={custom_potion_effects:[{id:"minecraft:hero_of_the_village",amplifier:103b}]}] run function zzzzdonotuse:weapons/emeraldarrowcrossbow
execute as @s[nbt={custom_potion_effects:[{id:"minecraft:hero_of_the_village",amplifier:104b}]}] run function zzzzdonotuse:weapons/netheritearrowcrossbow
execute as @s[nbt={custom_potion_effects:[{id:"minecraft:hero_of_the_village",amplifier:105b}]}] run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,tag=SpecArrRep] run function zzzzdonotuse:weapons/enderarrowcrossbow
execute as @s[nbt={custom_potion_effects:[{id:"minecraft:hero_of_the_village",amplifier:106b}]}] run function zzzzdonotuse:weapons/shulkerarrowcrossbow

execute at @s positioned ~ ~ ~ run data merge entity @e[type=arrow,limit=1,sort=nearest,distance=..1.5,tag=SpecArrRep] {crit:1b,Owner:[I;441,1333,343,134]}
execute at @s positioned ~ ~ ~ run data modify entity @e[type=arrow,limit=1,sort=nearest,distance=..1.5,tag=SpecArrRep] Owner set from entity @s Owner
execute at @s positioned ~ ~ ~ run data modify entity @e[type=arrow,limit=1,sort=nearest,distance=..1.5,tag=SpecArrRep] PierceLevel set from entity @s PierceLevel
execute at @s positioned ~ ~ ~ run data modify entity @e[type=arrow,limit=1,sort=nearest,distance=..1.5,tag=SpecArrRep] Motion[0] set from entity @s Motion[0]
execute at @s positioned ~ ~ ~ run data modify entity @e[type=arrow,limit=1,sort=nearest,distance=..1.5,tag=SpecArrRep] Motion[1] set from entity @s Motion[1]
execute at @s positioned ~ ~ ~ run data modify entity @e[type=arrow,limit=1,sort=nearest,distance=..1.5,tag=SpecArrRep] Motion[2] set from entity @s Motion[2]
execute at @s positioned ~ ~ ~ run tag @e[type=arrow,limit=1,sort=nearest,distance=..1.5,tag=SpecArrRep] remove SpecArrRep
kill @s






#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run execute store result score @s KyuDummy run data get entity @s PierceLevel
############################################################################################################################dont mind me using PosX as a second dummy here
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run scoreboard players set @s PosX 2
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run scoreboard players operation @s PosX *= @s KyuDummy
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run scoreboard players add @s PosX 12
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run scoreboard players operation @s KyuDummy = @s PosX
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run data merge entity @s {PierceLevel:0b}
#
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run execute store result score @s PosX run data get entity @s Motion[0] 10000
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run execute store result score @s PosY run data get entity @s Motion[1] 10000
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run execute store result score @s PosZ run data get entity @s Motion[2] 10000
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run scoreboard players operation @s PosX *= @s KyuDummy
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run scoreboard players operation @s PosY *= @s KyuDummy
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run scoreboard players operation @s PosZ *= @s KyuDummy
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run execute store result entity @s Motion[0] double .00001 run scoreboard players get @s PosX
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run execute store result entity @s Motion[1] double .00001 run scoreboard players get @s PosY
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run execute store result entity @s Motion[2] double .00001 run scoreboard players get @s PosZ
#execute at @s positioned ~ ~1.5 ~ run execute as @e[type=arrow,limit=1,sort=nearest,distance=..1.5,nbt={life:0s},tag=!GotMot] run tag @s add GotMot

