execute as @s[scores={weapon_combo=1..,weapon_combo_reset=..0}] run scoreboard players set @s weapon_combo 0
execute as @s[scores={weapon_combo_reset=1..}] run scoreboard players remove @s weapon_combo_reset 1
execute if score .weapon_cd knight matches 1.. run scoreboard players remove .weapon_cd knight 1

execute anchored eyes at @s positioned ^ ^ ^ rotated ~ ~ as @e[type=item_display,tag=aj.knight_weapon.root] run tp @s ^ ^-1 ^1 ~ ~

# execute as @s[scores={rc_special_2=1..}] at @s anchored eyes run particle dust{color:[1.0,0.0,0.0],scale:0.5} ^-0.25 ^ ^0.25 0.05 0.05 0.05 5 1
# execute as @s[scores={rc_special_2=1..}] run scoreboard players remove @s rc_special_2 1

#hit
# execute at @s[scores={knight=1..}] positioned ~-2.5 ~-2.5 ~-2.5 as @e[type=#main:enemies,tag=enemy,dx=4,dz=4,dy=4] run function main:characters/knight/weapon/id1/hit
execute at @e[type=item_display,tag=knight_sword] positioned ~-1 ~-1 ~-1 as @e[type=#main:enemies,tag=enemy,dx=1,dz=1,dy=1] run function main:characters/knight/weapon/id1/hit
execute as @s[tag=knight_rc] at @s run item modify entity @s weapon main:knight/knight_1
execute as @s[tag=!knight_rc] at @s run item modify entity @s weapon main:knight/knight

# #particle
# execute as @e[type=marker,tag=knight_sword_marker_id1] at @s positioned as @p[tag=knight,limit=1] run tp @s ^ ^ ^ ~20 ~
# execute as @e[type=marker,tag=knight_sword_marker_id2] at @s positioned as @p[tag=knight,limit=1] run tp @s ^ ^ ^ ~-20 ~
# execute as @e[type=marker,tag=knight_sword_marker_id3] at @s positioned as @p[tag=knight,limit=1] run tp @s ^ ^ ^ ~20 ~
# execute as @e[type=marker,tag=knight_sword_marker_id4] at @s positioned as @p[tag=knight,limit=1] run tp @s ^ ^ ^ ~-20 ~

# execute as @e[type=item_display,tag=knight_sword_id1] at @e[type=marker,tag=knight_sword_marker_id1,limit=1] run tp @s ^ ^0.5 ^1.25 ~90 ~
# execute as @e[type=item_display,tag=knight_sword_id2] at @e[type=marker,tag=knight_sword_marker_id2,limit=1] run tp @s ^ ^0.5 ^-1.25 ~-90 ~
# execute as @e[type=item_display,tag=knight_sword_id3] at @e[type=marker,tag=knight_sword_marker_id3,limit=1] run tp @s ^ ^0.5 ^1.25 ~90 ~
# execute as @e[type=item_display,tag=knight_sword_id4] at @e[type=marker,tag=knight_sword_marker_id4,limit=1] run tp @s ^ ^0.5 ^-1.25 ~-90 ~