Smithed Summit is back! Check it out here!
Download
Choose Minecraft Version
1.21.1026.2v1.0.6
1.21.1026.1.2v1.0.6
1.21.1026.1.1v1.0.6
1.21.1026.1v1.0.6
1.21.101.21.11v1.0.6
1.21.101.21.10v1.0.6
1.21.101.21.9v1.0.6
1.21.101.21.8v1.0.6
1.21.101.21.7v1.0.6
1.21.101.21.6v1.0.6
1.21.101.21.5v1.0.6
1.21.101.21.4v1.0.6
1.21.101.21.3v1.0.6
1.21.101.21.2v1.0.6
1.21.101.21.1v1.0.6
1.21.101.21v1.0.6
1.21.101.20.6v1.0.6
1.21.101.20.5v1.0.6
1.21.101.20.4v1.0.6
1.21.101.20.3v1.0.6
1.21.101.20.2v1.0.2
1.21.101.20.1v1.0.2
1.21.101.20v1.0.2
Close

HeightBoxLib

Hitbox related library datapack for geting the height of an entity.

Usage

Execute as an entity at itself and run hblib:util/get_height or any of the other variants.

The height position of both the entity's eye anchor and the hitbox height will be outputted as hblib:hitbox eye and hblib:hitbox out in storage.

The height and eye values can be obtained in score as #Eye hblib.number and #Total hblib.number

Example: Making an entity face a torso of a player

##This is from the targetted entity
scoreboard players set #Player hblib.number 1
function hblib:util/get_height

##Full - Eye height
scoreboard players operation #Temp plate_havoc.temp = #Total hblib.number
scoreboard players operation #Temp plate_havoc.temp -= #Eye hblib.number
#Full /2
scoreboard players operation #Temp2 plate_havoc.temp = #Total hblib.number
scoreboard players operation #Temp2 plate_havoc.temp /= #2 plate_havoc.temp
#Halved + Temp
execute store result storage plate_havoc:custom torso double 0.01 run scoreboard players operation #Temp plate_havoc.temp += #Temp2 plate_havoc.temp

execute anchored eyes as 00000000-0000-0005-0000-0001000007e9 run function plate_havoc:game/misc/face_torso/execute with storage plate_havoc:custom

Variants

hblib:util/get_height | Gets height of an entity's hitbox
hblib:util/get_height_dy | Height of an entity's hitbox -0.01
hblib:util/get_halved | Height of an entity's hitbox /2.

Smithed

Copyright © 2023-2026 Smithed
Not an official Minecraft product. Not approved by or associated with Mojang Studios