# #VB.Result vb.dummy9 is a success score, set to 0 outside this function, to check if a mob was hit successfully

## All mobs (within 1 block)
$execute as @e[distance=..1$(conditions)] run scoreboard players set #VB.Result vb.dummy9 1
$execute as @e[distance=..1$(conditions)] run damage @s $(amount) $(type)$(extra)

## Humanoid
$execute positioned ~ ~-1 ~ as @e[distance=..1$(conditions)] if entity @s[type=#vb:hitbox/humanoid] run scoreboard players set #VB.Result vb.dummy9 1
$execute positioned ~ ~-1 ~ as @e[distance=..1$(conditions)] if entity @s[type=#vb:hitbox/humanoid] run damage @s $(amount) $(type)$(extra)

## Tall humanoid
$execute positioned ~ ~-1 ~ as @e[distance=..1$(conditions)] if entity @s[type=#vb:hitbox/tall_humanoid] run scoreboard players set #VB.Result vb.dummy9 1
$execute positioned ~ ~-1 ~ as @e[distance=..1$(conditions)] if entity @s[type=#vb:hitbox/tall_humanoid] run damage @s $(amount) $(type)$(extra)
$execute positioned ~ ~-2 ~ as @e[distance=..1$(conditions)] if entity @s[type=#vb:hitbox/tall_humanoid] run scoreboard players set #VB.Result vb.dummy9 1
$execute positioned ~ ~-2 ~ as @e[distance=..1$(conditions)] if entity @s[type=#vb:hitbox/tall_humanoid] run damage @s $(amount) $(type)$(extra)

## Huge humanoid
$execute positioned ~ ~-1 ~ as @e[distance=..1.3$(conditions)] if entity @s[type=#vb:hitbox/huge_humanoid] run scoreboard players set #VB.Result vb.dummy9 1
$execute positioned ~ ~-1 ~ as @e[distance=..1.3$(conditions)] if entity @s[type=#vb:hitbox/huge_humanoid] run damage @s $(amount) $(type)$(extra)
$execute positioned ~ ~-2 ~ as @e[distance=..1.3$(conditions)] if entity @s[type=#vb:hitbox/huge_humanoid] run scoreboard players set #VB.Result vb.dummy9 1
$execute positioned ~ ~-2 ~ as @e[distance=..1.3$(conditions)] if entity @s[type=#vb:hitbox/huge_humanoid] run damage @s $(amount) $(type)$(extra)

## Short humanoid
$execute positioned ~ ~-0.6 ~ as @e[distance=..1$(conditions)] if entity @s[type=#vb:hitbox/short_humanoid] run scoreboard players set #VB.Result vb.dummy9 1
$execute positioned ~ ~-0.6 ~ as @e[distance=..1$(conditions)] if entity @s[type=#vb:hitbox/short_humanoid] run damage @s $(amount) $(type)$(extra)

## Large animal
$execute positioned ~ ~-1 ~ as @e[distance=..1.3$(conditions)] if entity @s[type=#vb:hitbox/large_animal] run scoreboard players set #VB.Result vb.dummy9 1
$execute positioned ~ ~-1 ~ as @e[distance=..1.3$(conditions)] if entity @s[type=#vb:hitbox/large_animal] run damage @s $(amount) $(type)$(extra)

## Gargantuan
$execute as @e[distance=..3$(conditions)] if entity @s[type=#vb:hitbox/gargantuan] run scoreboard players set #VB.Result vb.dummy9 1
$execute as @e[distance=..3$(conditions)] if entity @s[type=#vb:hitbox/gargantuan] run damage @s $(amount) $(type)$(extra)

## Size varies
$execute positioned ~ ~-1 ~ as @e[distance=..1.6$(conditions)] if entity @s[type=#vb:hitbox/size_varies,nbt={Size:3}] run scoreboard players set #VB.Result vb.dummy9 1
$execute positioned ~ ~-1 ~ as @e[distance=..1.6$(conditions)] if entity @s[type=#vb:hitbox/size_varies,nbt={Size:3}] run damage @s $(amount) $(type)$(extra)
$execute positioned ~ ~-1 ~ as @e[distance=..1.3$(conditions)] if entity @s[type=#vb:hitbox/size_varies,nbt={Size:2}] run scoreboard players set #VB.Result vb.dummy9 1
$execute positioned ~ ~-1 ~ as @e[distance=..1.3$(conditions)] if entity @s[type=#vb:hitbox/size_varies,nbt={Size:2}] run damage @s $(amount) $(type)$(extra)
