Hitbox Api Mod adds more common collider shapes to Minecraft as a library mod. It brings five new collider types: Oriented Bounding Box (OBB), Sphere, Capsule, Ray, and Compound. With this mod, multiple colliders can be combined into one composite shape, and you can also cache and view hitboxes on mobs in-game.

Hitbox Api Mod

Features:

  • Compound Colliders: Combines multiple colliders into one single collider, and lets composite colliders be nested inside each other.
  • Entity Collider Caching: Caches collider boxes on entities by attaching HitboxDataAttachments#COLLISION, though this cached data is not saved permanently.
  • Adds Oriented Bounding Box (OBB), Sphere, Capsule, and Ray collider shapes for collision detection.
  • Lets you see cached colliders rendered in the game by pressing the F3 + B shortcut.
  • Includes the ColliderUtil class with methods to check if a collision has happened.

Collider Performance Benchmark:

Tested with JMH Benchmark (5 warm-up rounds, 5 test rounds) on an AMD R5 5600G CPU with 32GB memory and Microsoft OpenJDK 21.0. Higher scores mean better speed when checking collisions between the same collider type, while rotated entries include the time needed to rotate the collider and recalculate its vectors:

Collider Score Error Unit
Axis-Aligned Bounding Box 3561837865.930 157982649.213 Ops/s
Sphere 119556589.705 1711146.560 Ops/s
Capsule 22350681.198 238993.658 Ops/s
Rotated Capsule 16842309.523 103959.918 Ops/s
Oriented Bounding Box 5528493.224 64548.996 Ops/s
Rotated Oriented Bounding Box 4648963.750 111369.535 Ops/s

How to Use:

  1. Create a collider object wherever you need collision detection.
  2. Use the methods inside ColliderUtil to check if a collision has occurred.
  3. Attach HitboxDataAttachments#COLLISION to an Entity to turn on collider box caching for it.
  4. Press F3 + B in the game to render and view the cached collider box on the screen.

Requirements:

Hitbox Api Mod Download Links

For Minecraft 1.21.11, 1.21.10, 1.21.9

Click to rate this post!
[Total: 0 Average: 0]