Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Model Engine 4 Model Engine 4
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 108
    • Issues 108
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • Model Engine 4Model Engine 4
  • Issues
  • #217

Closed
Open
Created May 12, 2025 by d5001@d5001

Conflict with Independent Mount Plugin

I wrote a mount plugin, which is a new entity. Players can right-click to ride the entity and operate it normally, including flying. However, when I add a ModelEngine4 model to this entity, the player mounts it but immediately dismounts! How can I resolve this issue?

@Override
public void setModel(Entity entity, String model) {
    String[] args = model.split(" ");

    ModelBlueprint blueprint = ModelEngineAPI.getBlueprint(args[0]);
    if (blueprint != null) {
        ModelOptionParser options = ModelOptionParser.parse(1, args);
        Location location = entity.getLocation();
        BukkitEntity base = new BukkitEntity(entity);
        base.getBodyRotationController().setYBodyRot(location.getYaw());
        ModeledEntity modeledEntity = ModelEngineAPI.createModeledEntity(base);
        modeledEntity.setBaseEntityVisible(false);
        ActiveModel activeModel = ModelEngineAPI.createActiveModel(blueprint);
        activeModel.setAutoRendererInitialization(false);
        options.applyDisguiseOptions(activeModel);
        modeledEntity.addModel(activeModel, true);
        activeModel.initializeRenderer();

        activeModel.getMountManager().ifPresent((mountManager) -> {
            mountManager.setCanRide(true);
            mountManager.setCanDrive(true);
            modeledEntity.getMountData().setMainMountManager(mountManager);
        });
    }
}
Edited May 13, 2025 by d5001
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking