// Spawn a new entityPig pig = location.getWorld().spawn(location, Pig.class);// Create a new ModeledEntity from the spawned entityModeledEntity modeledEntity = ModelEngineAPI.createModeledEntity(pig);// Create a new ActiveModel using the ID of a model// Will throw an error if the model does not existActiveModel activeModel = ModelEngineAPI.createActiveModel("test_model");// Add the model to the entitymodeledEntity.addModel(activeModel, true);
Removing model
// Grab the ModeledEntity instance associated with the entity// Can also use entity ID or entity UUIDModeledEntity modeledEntity = ModelEngineAPI.getModeledEntity(pig);// Remove the modelmodeledEntity.removeModel("test_model");