Hitbox

From Minecraft Wiki
Jump to: navigation, search

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.

Block[edit]

This section needs expansion.
You can help by adding to it.

Collision box[edit]

Collision box is used to manage collision with entities.

Collision box is not present for all blocks, as many blocks such as grass, signs and torch have no collision box.

Outline box[edit]

Outline box is shown when looking at a given block. It become visible as a wireframe outline when the crosshairs are pointed at the block.

Interaction box[edit]

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. There are some exceptions:[more information needed]

Block support shape[edit]

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.

Entity[edit]

This section needs expansion.
You can help by adding to it.

The hitboxes of most entities (except ender dragon) are always shaped in cuboids, 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.

Boundary box[edit]

The boundary box of entities can be viewed via the F3 + B debug shortcut. ‌[Java Edition only]

Interaction box[edit]

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.

History[edit]

Java Edition
1.4.41.4.3F3 + B now shows the hitbox around entities. At this point, the hitbox is white and opaque and does not have an outline.
1.1317w47aThe outline boxess of anvils and hoppers now much more closely fit the model shape of these blocks.
The hitbox of brewing stands now takes into account the central rod as well.[1]
The outline boxes of fences is now correctly L-shaped, T-shaped or +-shaped when branching in perpendicular directions.[2]
Cactus now has a correct cuboid outline box.[3]
Blocks containing multiple vines now have better outline boxes.
Glass panes and iron bars have cleaner outline boxes when branching.
End portal frame outline boxes now properly account for the eye.
Piston and lily pad outline boxes were changed.
The collision box of walls has been made to be correctly concave.[4]
1.1418w48aThe outline boxes of beds now better matches the visual shape of the bed.
19w13aThe outline boxes of cauldrons now better fits the model, allowing for blocks beneath it to be targeted.[5]
1.1620w10aFire now has an outline box (alongside soul fire),[6] bringing it more in line with other blocks. Previously, fire had no outline box at all, and breaking it required targeting underlying blocks, which also allowed it to be put out in Creative mode when holding a sword or trident, which were programmed to not break blocks. It also prevented its block states from being read in the debug screen or modified via debug stick.
20w18aThe outline box of redstone wire has now been changed to much more closely the visual shape of the block. For example, redstone wire branching in different directions causes its outline box to itself branch in said directions,[7] mirroring the behavior of fences, glass panes, iron bars and walls, and, if traveling up the side of a block, the vertical portion of the dust can now also be targeted.[8]

Trivia[edit]

  • Fluids do not have hitboxes, even in cases where they would behave like a block.[9]
  • The ender dragon is composed of nine distinct hitboxes.

References[edit]