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 111
    • Issues 111
    • 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
  • Wiki
    • Api
    • Basic
  • Add Remove Model

Last edited by Ticxo Sep 29, 2023
Page history
This is an old version of this page. You can view the most recent version or browse the history.

Add Remove Model

Adding model

// Spawn a new entity
Pig pig = location.getWorld().spawn(location, Pig.class);
// Create a new ModeledEntity from the spawned entity
ModeledEntity modeledEntity = ModelEngineAPI.createModeledEntity(pig);
// Create a new ActiveModel using the ID of a model
// Will throw an error if the model does not exist
ActiveModel activeModel = ModelEngineAPI.createActiveModel("test_model");
// Add the model to the entity
modeledEntity.addModel(activeModel, true);

Removing model

// Grab the ModeledEntity instance associated with the entity
// Can also use entity ID or entity UUID
ModeledEntity modeledEntity = ModelEngineAPI.getModeledEntity(pig);
// Remove the model
modeledEntity.removeModel("test_model");
Clone repository
Home
FAQ / Common Issues
Commands & Permissions
Configuration
Modeling
  • Creating a Model
    • Hitbox & Eye Height
    • Shadow
  • Bone Behaviors
  • Animating a Model
  • Importing a Model
  • Scriptable Keyframes
MythicMobs
  • Mechanics: Model
  • Mechanics: VFX
  • Conditions
  • Targeters
API
  • Basic
    • Apply / Remove Model
    • Play / Stop Animation
    • Configure Bone Behaviors
    • Per-Player Model
    • Events
  • Advanced
    • Custom Base Entity
    • Custom Mount Controller
    • Custom Importer
    • Custom Bone Behaviors
    • Custom Script Reader
    • Custom Timeline
    • Custom Animation Handler
    • Custom Render Type
Technical
  • Terminology
  • Animation Systems
  • Mount Controllers