execute store result score #pos.x portal.tmp run data get entity @s Pos[0] 10000
execute store result score #pos.y portal.tmp run data get entity @s Pos[1] 10000
execute store result score #pos.z portal.tmp run data get entity @s Pos[2] 10000

function #bs.hitbox:get_entity

execute store result score #half_width portal.tmp run data get storage bs:out hitbox.width 5000
execute store result score #half_depth portal.tmp run data get storage bs:out hitbox.depth 5000
#scoreboard players operation #half_width portal.tmp /= #2 num

execute store result score #height portal.tmp run data get storage bs:out hitbox.height 10000

scoreboard players operation #en.x.min portal.tmp = #pos.x portal.tmp
scoreboard players operation #en.x.min portal.tmp -= #half_width portal.tmp

scoreboard players operation #en.y.min portal.tmp = #pos.y portal.tmp

scoreboard players operation #en.z.min portal.tmp = #pos.z portal.tmp
scoreboard players operation #en.z.min portal.tmp -= #half_depth portal.tmp

scoreboard players operation #en.x.max portal.tmp = #pos.x portal.tmp
scoreboard players operation #en.x.max portal.tmp += #half_width portal.tmp

scoreboard players operation #en.y.max portal.tmp = #pos.y portal.tmp
scoreboard players operation #en.y.max portal.tmp += #height portal.tmp

scoreboard players operation #en.z.max portal.tmp = #pos.z portal.tmp
scoreboard players operation #en.z.max portal.tmp += #half_depth portal.tmp