Hitbox Api
Collision detection is the invisible engine behind almost everything that feels right in Minecraft. Whether a player squeezes through a narrow gap, an arrow glances off a shoulder, or a custom mob navigates a cave, the game is quietly asking one question: did these two shapes touch? Vanilla answers that question with simple axis-aligned boxes, which are fast but blunt. Hitbox Api gives mod and datapack developers a far richer toolkit, adding oriented bounding boxes, spheres, capsules, rays, and compound shapes that can be nested and combined. If you have ever wanted collision that matches the actual shape of your entity instead of a blocky approximation, this is the library to know.
What Hitbox Api Brings to the Table
At its core, the add-on expands the vocabulary of collision shapes available to developers. Instead of being limited to the classic axis-aligned bounding box (AABB), you can now describe objects with geometry that actually fits them. That opens the door to tighter hit detection, more believable combat, and physics-driven contraptions that behave the way players expect.
- Axis-Aligned Bounding Box — the familiar, lightning-fast standby for simple checks.
- Oriented Bounding Box (OBB) — a box that can rotate, perfect for angled structures and vehicles.
- Sphere — ideal for round projectiles and radial effects.
- Capsule — a cylinder with rounded ends, great for humanoid limbs and beams.
- Ray — for line-of-sight and hitscan style detection.
- Compound — multiple colliders merged into a single shape, with nesting supported.
Because compound colliders can be nested, you can build surprisingly detailed hitboxes from simple parts. A dragon's wing, a mech's arm, or a sprawling boss with several weak points all become manageable when you can group smaller shapes into one logical unit.
How to Install and Get Started
The first step for most players is to download Hitbox Api and drop it into their mods folder alongside the loader it targets. It is built for the Fabric ecosystem and supports modern Minecraft releases, so check that your game version lines up with the build you grab. As with any library mod, it usually needs to sit next to the mods that depend on it rather than running on its own.
Installing Hitbox Api for Minecraft
If you are wondering how to install it cleanly, the process is refreshingly short:
- Confirm you are running a Fabric profile for a supported Minecraft version.
- Place the Hitbox Api jar file into your mods directory.
- Add any companion mods that rely on it to the same folder.
- Launch the game and verify the mod loads without errors in the log.
For players who would rather skip manual file juggling, the foxygame.net launcher makes short work of it: its built-in add-on catalog lets you install Hitbox Api with a single click, and it keeps the library updated automatically as new Minecraft versions roll out. That convenience matters when a dependency like this needs to stay in sync with the mods that call on it.
Using Colliders in Your Code
The workflow is straightforward for anyone comfortable with Java. Wherever collision detection is needed, you create a collider object and then lean on the helper methods in ColliderUtil to determine whether an intersection has occurred. For entities, the add-on offers collider caching through HitboxDataAttachments#COLLISION, which spares you from rebuilding shapes every tick. A handy debugging touch: press F3 + B in-game to render the cached collider and see exactly what the game is testing against.
One caveat worth flagging early is that this data attachment has no persistence implementation. In practice, that means cached colliders are rebuilt at runtime rather than saved to disk, so plan your logic around re-initialization after a reload.
Performance You Can Rely On
Richer shapes usually cost more computation, and the developer behind the project was transparent about the trade-offs. Benchmarking was done with JMH on an AMD R5 5600G with 32GB of RAM and Microsoft OpenJDK 21, using five warm-up rounds and five test rounds. The results tell a clear story: axis-aligned boxes remain the fastest by a wide margin at roughly 3.5 billion operations per second, spheres follow at around 119 million, capsules land near 22 million, and oriented boxes sit in the low millions. Rotated variants cost more still, since the relevant vectors must be recalculated each time.
The takeaway is not that one shape is "best" but that you should match the collider to the job. Use AABBs for bulk checks, reserve OBBs and capsules for the cases where accuracy genuinely matters, and cache aggressively. With that discipline, Hitbox Api for Minecraft delivers precision without tanking your tick rate.
Final Thoughts
Hitbox Api fills a genuine gap in the modding toolbox. It hands developers a flexible, well-documented set of collision primitives, from simple spheres to nested compound shapes, and backs it up with honest performance data. If your project needs hit detection that respects real geometry, this library is a smart foundation to build on.