execute store result storage hitbox coordinates.x int 1 run scoreboard players get @s hitbox_x_temp
execute store result storage hitbox coordinates.y int 1 run scoreboard players get @s hitbox_y_temp
execute store result storage hitbox coordinates.z int 1 run scoreboard players get @s hitbox_z_temp
$data modify storage hitbox coordinates.id set value $(id)
$data modify storage hitbox coordinates.character set value $(character)
$data modify storage hitbox coordinates.type set value $(type)
$data modify storage hitbox coordinates.mob set value $(mob)
$data modify storage hitbox coordinates.texture set value '$(texture)'
$data modify storage hitbox coordinates.gridbox set value '$(gridbox)'
$data modify storage hitbox coordinates.positioned set value '$(positioned)'

execute at @s run function main:mechanics/interaction/weapon/attack/hitbox/spawn with storage hitbox coordinates

#iterating x
execute if score @s hitbox_x > @s hitbox_x_temp run scoreboard players add @s hitbox_x_temp 1

#when finished - switch lanes up
execute if score @s hitbox_x <= @s hitbox_x_temp if score @s hitbox_y > @s hitbox_y_temp run scoreboard players add @s hitbox_y_temp 1
execute if score @s hitbox_x <= @s hitbox_x_temp if score @s hitbox_y > @s hitbox_y_temp run scoreboard players set @s hitbox_x_temp 0

#if both x and y are equal then switch z
execute if score @s hitbox_x <= @s hitbox_x_temp if score @s hitbox_y <= @s hitbox_y_temp if score @s hitbox_z > @s hitbox_z_temp run scoreboard players add @s hitbox_z_temp 1

# #center
# execute if score @s hitbox_x <= @s hitbox_x_temp if score @s hitbox_y <= @s hitbox_y_temp if score @s hitbox_z <= @s hitbox_z_temp run function main:mechanics/interaction/weapon/attack/hitbox/center with storage hitbox coordinates

#z iteration
execute if score @s hitbox_x <= @s hitbox_x_temp if score @s hitbox_y <= @s hitbox_y_temp if score @s hitbox_z > @s hitbox_z_temp run function main:mechanics/interaction/weapon/attack/hitbox/math_2

$execute if score @s hitbox_x > @s hitbox_x_temp at @s run function main:mechanics/interaction/weapon/attack/hitbox/math_1 {"id":$(id),"character":$(character),"type":$(type),"mob":$(mob),"texture":'$(texture)',"gridbox":'$(gridbox)',"positioned":"$(positioned)"}
$execute if score @s hitbox_y > @s hitbox_y_temp at @s run function main:mechanics/interaction/weapon/attack/hitbox/math_1 {"id":$(id),"character":$(character),"type":$(type),"mob":$(mob),"texture":'$(texture)',"gridbox":'$(gridbox)',"positioned":"$(positioned)"}
$execute if score @s hitbox_z > @s hitbox_z_temp at @s run function main:mechanics/interaction/weapon/attack/hitbox/math_1 {"id":$(id),"character":$(character),"type":$(type),"mob":$(mob),"texture":'$(texture)',"gridbox":'$(gridbox)',"positioned":"$(positioned)"}