MythicMobs + ModelEngine Projectil Bounces Bug
Summary
When configuring a projectile to bounce in MythicMobs, using a ModelEngine entity, an error related to the projectile's bounding box occurs. The error indicates that the bounding boxes do not overlap and suggests that the bounding box might have been set to zero.
Steps to reproduce
- Set up an entity in ModelEngine.
- Configure a projectile in MythicMobs to use the ModelEngine entity with the following properties: bounce=true, bouncevelocity=0.95, and 3. other related properties.
- Launch the projectile in-game.
- Observe the error in the server console.
https://mclo.gs/3RshWkO (Mob and Skill)
This is the hitbox configuration of the model Current behavior
When the configured projectile, which uses a ModelEngine entity, is launched, an error related to bounding boxes appears in the server console. The error indicates that the bounding boxes do not overlap.
Intended correct behavior
The projectile, utilizing a ModelEngine entity, should bounce correctly without producing errors in the server console. Bounding boxes should function correctly to calculate the projectile's bounce.
Server log file
Debug log snippet
Proposed fixes
Before reaching this exception check that modelengine is installed on the server and recover its hitbox. it would be something like this
ModeledEntity modeledEntity = ModelEngineAPI.getModeledEntity(api.getMythicMobInstance(entity).getUniqueId());
if (modeledEntity != null) {
Hitbox hitbox = modeledEntity.getBase().getHitbox();
boundingBox = new BoundingBox(hitbox.getMaxWidth(), hitbox.getHeight(), hitbox.getDepth());
}