Back to mods
MECHA - Multiple Entity Collision Hitboxes API project artwork

Modrinth · Minecraft mod

MECHA - Multiple Entity Collision Hitboxes API

Fabric API for implementing multiple collider hitboxes for a single entity

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which MECHA - Multiple Entity Collision Hitboxes API release matches 1.19.4?

Updated 2 years ago
alpha file 0.1.2
Game version 1.19.4, 1.20, 1.20.1
Loader Fabric

MECHA - Multiple Entity Collision Hitboxes API 0.1.2 targets 1.19.4, 1.20, 1.20.1 with Fabric. Installation on the client is optional. Installation on the dedicated server is optional. No extra mods listed for this file.

Where it goes

Is MECHA - Multiple Entity Collision Hitboxes API required on the client, server, or both?

Installation on the client is optional. Installation on the dedicated server is optional.

Client Optional
Dedicated server Optional
Loader for this release Fabric
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source marks this as usable on both the client and server.

What else does MECHA - Multiple Entity Collision Hitboxes API 0.1.2 need?

0.1.2 on 1.19.4. Every mod below is checked against that same setup.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add MECHA - Multiple Entity Collision Hitboxes API without breaking your instance.

Built for MECHA - Multiple Entity Collision Hitboxes API 0.1.2 on 1.19.4. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use 0.1.2. It targets 1.19.4, 1.20, 1.20.1 with Fabric; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    Installation on the client is optional. Installation on the dedicated server is optional.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside 0.1.2. It opens that exact file at the source.

About this project

What does MECHA - Multiple Entity Collision Hitboxes API add?

A simple API for enabling custom entities to implement more than one collision box.

Setup

Add the Modrinth Maven and the right version of the mod to your build.gradle file:

repositories {
	maven { url 'https://api.modrinth.com/maven' }
}

dependencies {
	modImplementation "maven.modrinth:mecha-api:VERSION_GOES_HERE"
}

Usage

Implement MultiCollidable in your custom entity class, and override getColliders to add extra colliders to the entity.

Example

The following example code adds 2 colliders to an entity, each the size of a slab:

public CustomEntity extends Entity implements MultiCollidable {
    public List<VoxelShape> getColliders() {
        List<VoxelShape> colliders = new ArrayList<>();
        BlockPos pos = this.blockPos();
        double x = pos.getX();
        double y = pos.getY();
        double z = pos.getZ();
        colliders.add(VoxelShapes.cuboid(x, y, z, x+1, y+0.5, z+1));
        colliders.add(VoxelShapes.cuboid(x, y+0.5, z, x+1, y+1, z+1));
        return colliders;
    }
}

For 0.1.2 and newer, there is now also a custom entity type, DynamicBoundingBoxEntity, which has a dynamic bounding box based on the list returned by getColliders():

public CustomEntity extends DynamicBoundingBoxEntity {
    // The bounding box of this entity will dynamically resize
    // to fit the colliders returned by this function
    @Override
    public List<VoxelShape> getColliders() { ... }
}

Project description from Modrinth.

Pick your setup

MECHA - Multiple Entity Collision Hitboxes API by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

10 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

MECHA - Multiple Entity Collision Hitboxes API versions and loaders

3 of 5 releases match
Clear filters

Looking for an older file? The official Modrinth project page is in Resources.