
Modrinth · Minecraft mod
MECHA - Multiple Entity Collision Hitboxes API
Fabric API for implementing multiple collider hitboxes for a single entity
Quick answer
Which MECHA - Multiple Entity Collision Hitboxes API release matches 1.19.4?
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.
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.
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.
- 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.
- 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.
- 03
Put it on the correct side
Installation on the client is optional. Installation on the dedicated server is optional.
- 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.
1.21
1 loader build1.20.6
1 loader build1.20.5
1 loader build1.20.4
1 loader build1.20.3
1 loader build1.20.2
1 loader build1.20.1
1 loader build1.20
1 loader build1.19.4
1 loader buildCheck 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
0.1.2
mecha-0.1.2.jar
11 Sept 2024
0.1.1+1.19.4
mecha-0.1.1.jar
6 May 2024
0.1.0+1.19.4
mecha-0.1.0.jar
3 May 2024
Looking for an older file? The official Modrinth project page is in Resources.