Hitbox

A hitbox defines the physical "boundaries" (or an approximation thereof) of a block or entity. Hitboxes are utilised in the calculations of collisions and targeting.
Unlike with block models, all hitboxes are hardcoded and cannot be changed without modification, even via data packs.
== Hitbox==
===Collision box===
A collision box is used to manage collision with entities.
A collision box is not present for all blocks, as all non-solid blocks such as grass, signs, button, lever and torch have no collision box.
===Outline box===
An outline box is shown when looking at a given block. It becomes visible as a wireframe outline when a crosshair is pointed at the block.
===Interaction box===
An interaction box deals with aiming at blocks. When the interaction box of a block is targeted, the block can be broken, placed on or interacted with as necessary.
Its default is the same as the outline box. However, the interaction box is incapable of extending outside of its own block space, despite the outline box being capable of doing so visually. There are several instances where this can be seen: 
*The arm of an extended piston - specifically the part which protrudes into the piston's block space.
*The hitboxes of pointed dripstone in Java Edition 20w48a could sometimes also randomly extend into adjacent blocks, allowing this to be seen.
*The hitboxes of melon stems and pumpkin stems with ages 8 and over could visually extend into the block space above them while they existed (from Beta 1.8 Pre-release up to the removal of the last four in 14w10a and the remaining four in 14w25a).
*The hitboxes of cakes with 8 or more bites could extend into the adjacent block space while these existed (from Beta 1.2 up to their removal in 14w26a, although 14w25a likely made them too unstable to be properly observable)
*The hitboxes of cakes and cacti at far distances could previously (from Beta 1.2 and Alpha v1.0.11 respectively up to their fixing, likely simultaneously in 15w49a, although it became unobservable for cake from 15w38a onwards due to ) also become greater than a full block, allowing this to be seen.
== Block==
===Block support shape ===
A block support shape is mainly used to judge whether another attaching block (e.g. torches, doors, buttons, etc.) can be attached to it.
Its default is the same as the collision box. There are some exceptions:
*Leaves have an empty block support shape.
*The Block support shape of the snow layer is the same as its selection box.
*Soul sand has a full block support shape.
* Coded interactions like the Mangrove propagule
==Entity==
=== List of entity hitboxes ===
The hitboxes of all entities (except ender dragon, item frames, and paintings) are always shaped in cuboids (square base), which does not always overlap with the visual parameters of the entity. For example, the witch's hitbox does not include the top section of its hat, and the wither's hitbox does not include the two heads on its sides. Because most hitboxes are cuboids, it is standard to measure them by their width and height, with the width being the size of the base (which is a square) and height being the number of blocks tall (so a width of 0.6 means the entity is 0.6 blocks wide).
Below is a list of every entity's hitbox size (as of Java 1.19.2). The hitbox sizes of entities in Bedrock Edition vary greatly from the information below, which only gives Java hitboxes.
Entity Name 	Height 	Width 	Height Baby	Width Baby
allay 	0.6 	0.35 	 	
area_effect_cloud 	Varies 	Varies 	 	
armor_stand 	1.975 	0.5 	0.9875 	0.25
arrow 	0.5 	0.5 	 	
axolotl 	0.42 	0.75 	 	
bat 	0.9 	0.5 	 	
bee 	0.6 	0.7 	0.3 	0.35
blaze 	1.8 	0.6 	 	
boat 	0.5625 	1.375 	 	
cat 	0.7 	0.6 	0.35 	0.3
cave_spider 	0.5 	0.7 	 	
chest_boat 	0.5625 	1.375 	 	
chest_minecart 	0.7 	0.98 	 	
chicken 	0.7 	0.4 	0.35 	0.2
cod 	0.3 	0.5 	 	
command_block_minecart	0.7 	0.98 	 	
cow 	1.4 	0.9 	0.7 	0.45
creeper 	1.7 	0.6 	 	
dolphin 	0.6 	0.9 	 	
donkey 	1.5 	1.3965 	0.75 	0.6982
dragon_fireball 	1 	1 	 	
drowned 	1.95 	0.6 	0.975 	0.3
egg 	0.25 	0.25 	 	
elder_guardian 	1.9975 	1.9975 	 	
end_crystal 	2 	2 	 	
ender_dragon 	(Not cuboid)	(Not cuboid)	 	
ender_pearl 	0.25 	0.25 	 	
enderman 	2.9 	0.6 	 	
endermite 	0.3 	0.4 	 	
evoker 	1.95 	0.6 	 	
evoker_fangs 	0.8 	0.5 	 	
experience_bottle 	0.25 	0.25 	 	
experience_orb 	0.25 	0.25 	 	
eye_of_ender 	0.25 	0.25 	 	
falling_block 	0.98 	0.98 	 	
fireball 	1 	1 	 	
firework_rocket 	0.25 	0.25 	 	
fishing_bobber 	0.25 	0.25 	 	
fox 	0.7 	0.6 	0.35 	0.3
frog 	0.5 	0.5 	 	
furnace_minecart 	0.7 	0.98 	 	
ghast 	4 	4 	 	
giant 	12 	3.6 	 	
glow_item_frame 	(Not cuboid)	(Not cuboid)	 	
glow_squid 	0.8 	0.8 	 	
goat 	1.3 	0.9 	0.65 	0.45
guardian 	0.85 	0.85 	 	
hoglin 	1.4 	1.3965 	0.7 	0.6982
hopper_minecart 	0.7 	0.98 	 	
horse 	1.6 	1.3965 	0.8 	0.6982
husk 	1.95 	0.6 	0.975 	0.3
illusioner 	1.95 	0.6 	 	
iron_golem 	2.7 	1.4 	 	
item 	0.25 	0.25 	 	
item_frame 	(Not cuboid)	(Not cuboid)	 	
leash_knot 	0.5 	0.375 	 	
lightning_bolt 	0 	0 	 	
llama 	1.87 	0.9 	0.935 	0.45
llama_spit 	0.25 	0.25 	 	
magma_cube 	Varies 	Varies 	 	
minecart 	0.7 	0.98 	 	
mooshroom 	1.4 	0.9 	0.7 	0.45
mule 	1.6 	1.3965 	0.8 	0.6982
ocelot 	0.7 	0.6 	0.35 	0.3
painting 	(Not cuboid)	(Not cuboid)	 	
panda 	1.25 	1.3 	0.625 	0.65
parrot 	0.9 	0.5 	 	
phantom 	0.5 	0.9 	 	
pig 	0.9 	0.9 	0.45 	0.45
piglin 	1.95 	0.6 	 	
piglin_brute 	1.95 	0.6 	 	
pillager 	1.95 	0.6 	 	
player 	1.8 	0.6 	 	
polar_bear 	1.4 	1.4 	0.7 	0.7
potion 	0.25 	0.25 	 	
pufferfish 	0.35 	0.35 	 	
rabbit 	0.5 	0.4 	0.25 	0.2
ravager 	2.2 	1.95 	 	
salmon 	0.4 	0.7 	 	
sheep 	1.3 	0.9 	0.65 	0.45
shulker 	1 	1 	 	
shulker_bullet 	0.3125 	0.3125 	 	
silverfish 	0.3 	0.4 	 	
skeleton 	1.99 	0.6 	 	
skeleton_horse 	1.6 	1.3965 	0.8 	0.6982
slime 	Varies 	Varies 	 	
small_fireball 	0.3125 	0.3125 	 	
snow_golem 	1.9 	0.7 	 	
snowball 	0.25 	0.25 	 	
spawner_minecart 	0.7 	0.98 	 	
spectral_arrow 	0.5 	0.5 	 	
spider 	0.9 	1.4 	 	
squid 	0.8 	0.8 	 	
stray 	1.99 	0.6 	 	
strider 	1.7 	0.9 	0.85 	0.45
tadpole 	0.3 	0.4 	 	
tnt 	0.98 	0.98 	 	
tnt_minecart 	0.7 	0.98 	 	
trader_llama 	1.87 	0.9 	0.935 	0.45
trident 	0.25 	0.25 	 	
tropical_fish 	0.4 	0.5 	 	
turtle 	0.4 	1.2 	0.12 	0.36
vex 	0.8 	0.4 	 	
villager 	1.95 	0.6 	0.975 	0.3
vindicator 	1.95 	0.6 	 	
wandering_trader 	1.95 	0.6 	 	
warden 	2.9 	0.9 	 	
witch 	1.95 	0.6 	 	
wither 	3.5 	0.9 	 	
wither_skeleton 	2.4 	0.7 	 	
wither_skull 	0.3125 	0.3125 	 	
wolf 	0.85 	0.6 	0.425 	0.3
zoglin 	1.4 	1.3965 	0.7 	0.6982
zombie 	1.95 	0.6 	0.975 	0.3
zombie_horse 	1.6 	1.3965 	0.8 	0.6982
zombie_villager 	1.95 	0.6 	0.975 	0.3
zombified_piglin 	1.95 	0.6 	0.975 	0.3
 
=== Non-constant hitbox sizes ===
The size of an entity's hitbox is not necessarily static and may change depending on certain circumstances. For instance, a player's hitbox gets smaller while crouching, and the hitbox of a pufferfish changes while it's puffed out. Below is a list of all the entities who's hitbox can change sizes given specific causes. 
Enderman	Normal	While Angry
Height 	2.9 	3.25
Width 	0.6 	0.6
Player	Normal	While sneaking	While gliding/swimming	While sleeping
Height	1.8 	1.5 	0.6 	0.2
Width 	0.6 	0.6 	0.6 	0.2
Pufferfish	Unpuffed	Semi-puffed	Fully Puffed
Height 	0.35 	0.49 	0.7
Width 	0.35 	0.49 	0.7
Shulker	Closed	Peeking	Open
Height 	1 	1.2 	2
Width 	1 	1 	1
 
===Boundary box===
The boundary box of entities can be viewed via the + debug shortcut. 
===Interaction box===
Interaction box deals with aiming at entities. When the interaction box of an entity is targeted, the entity can be hit or interacted with as necessary.
===Eye level===
The eye level is outlined in red, and appears only on the hitboxes of all Entities. It is responsible for suffocation and drowning damage; a mob will take suffocation damage or lose air and drown if its eye level is inside a solid block or water respectively. Eye level also changes the rendering Minecraft uses if its eye level is inside water or lava respectively.
==History==
===Blocks===
====Collision boxes====
====Outline and interaction boxes====
===Entities===
====Boundary boxes====
*The hitboxes of pointed dripstone in Java Edition 20w48a could sometimes also randomly extend into adjacent blocks, allowing this to be seen.
*The hitboxes of melon stems and pumpkin stems with ages 8 and over could visually extend into the block space above them while they existed (from Beta 1.8 Pre-release up to the removal of the last four in 14w10a and the remaining four in 14w25a).
*The hitboxes of cakes with 8 or more bites could extend into the adjacent block space while these existed (from Beta 1.2 up to their removal in 14w26a, although 14w25a likely made them too unstable to be properly observable)
*The hitboxes of cakes and cacti at far distances could previously (from Beta 1.2 and Alpha v1.0.11 respectively up to their fixing, likely simultaneously in 15w49a, although it became unobservable for cake from 15w38a onwards due to ) also become greater than a full block, allowing this to be seen.
==Trivia==
*Fluids do not have hitboxes, even in cases where they would behave like a block. 
*The ender dragon is composed of nine distinct hitboxes.
==References==
de:Hitbox
pt:Caixa de colisão
zh:判定箱