### Mount and Dismount Model Example Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/DismountModel This example demonstrates mounting a player to a specific bone on interaction and dismounting them when the mob takes damage. ```yaml Skills: - model{m=elk;usm=true;drive=true;ride=true;n=nametag} @self ~onSpawn - mountmodel{mid=elk;d=false;p=seat2} @trigger ~onInteract # Dismount when the mob takes damage - dismountmodel{m=elk;p=seat2} @self ~onDamaged ``` -------------------------------- ### Set the VFX brightness Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/VFXBrightness This example applies a VFX with full block light and no sky light. ```yaml Skills: - skill{s=[ - vfx{mid=weapon_vfx;pid=fire_bolt} - vfxbrightness{block=15;sky=0} ]} @self ~onSpawn ``` -------------------------------- ### Root Motion Mechanic Example Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/RootMotion Demonstrates enabling and disabling the root motion override within a skill sequence. ```yaml Skills: - rootmotion{ov=true} - state{s=animation} - delay 100 - rootmotion{ov=false} ``` -------------------------------- ### Conditional MountedModel Skill Example Source: https://wiki.mythiccraft.io/modelengine/Skills/targeters/MountedModel A metaskill example that heals the model if the caster is driving, or ignites the model if the caster is a passenger. ```yaml ExampleSkill1: Conditions: - ridingmodel castinstead ExampleSkill2 - drivingmodel true Skills: - heal{a=10} @mountedmodel ExampleSkill2: Skills: - ignite @mountedmodel ``` -------------------------------- ### Gradually change color with vfxtint Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/VFXTint This example applies a VFX that starts as white and fades into a deep red over 3 seconds (60 ticks). ```yaml Skills: - skill{s=[ - vfx{mid=weapon_vfx;pid=fire_bolt} - vfxtint{ca=FFFFFF;cb=FF0000;duration=60} ]} @self ~onSpawn ``` -------------------------------- ### Showing a model with RenderInit Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/RenderInit This example demonstrates applying a model on spawn with initrender set to false, performing customizations like tinting and enchanting, and finally using renderinit to display the model. ```yaml Skills: - model{mid=testmodel;initrender=false} @self ~onSpawn # Customize the model further - tint{mid=testmodel;color=ff0000} @self ~onSpawn - enchant{mid=test} @self ~onSpawn # Finally, show the model - renderinit{mid=testmodel} @self ~onSpawn ``` -------------------------------- ### Implement custom attack animation with MythicMobs Source: https://wiki.mythiccraft.io/modelengine/FAQ This example shows how to set up a custom attack animation by cancelling the default attack event, playing a state, delaying, and then dealing damage. ```yaml ExampleMob: Type: ZOMBIE Skills: - model{mid=examplemob} @self ~onSpawn - skill{s=ExampleModelAttack;sync=true} @self ~onAttack ``` ```yaml ExampleModelAttack: Skills: - cancelevent - state{...} - delay 17 - damage{...} @trigger ``` -------------------------------- ### Pause an animation Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/ModifyState This example demonstrates how to play an animation, wait for one second, and then pause it by setting the speed attribute to 0. ```yaml Skills: # Play an animation - state{mid=fire_elemental;s=attack} @self # Delay 1 second - delay 20 # Stop the animation by setting speed to 0 - modstate{mid=fire_elemental;s=attack;sp=0} @self ``` -------------------------------- ### Apply brightness to a model part Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/Brightness This example demonstrates how to spawn a custom spider model and set its 'eyes' part to maximum brightness for both block and sky light. ```yaml Skills: - model{m=customSpider} @self ~onSpawn - brightness{p=eyes;b=15;s=15} @self ~onSpawn ``` -------------------------------- ### CustomAnimationHandler implementation Source: https://wiki.mythiccraft.io/modelengine/API/Advanced/Custom-Animation-Handler Example implementation of the AnimationHandler interface, showing all core methods that must be supplied by a custom handler. ```APIDOC ## CustomAnimationHandler ### Description Implements the AnimationHandler interface to provide custom animation logic for an ActiveModel. The handler is responsible for playing, blending, and stopping animations. ### Methods #### getActiveModel() - Returns the ActiveModel associated with this handler. #### getId() - Returns the registry key used when the model is saved/loaded. For a custom handler, this should be a unique id (e.g., "custom"). #### prepare() - Called every tick before bones update. Use this to advance animation state. #### updateBone(ModelBone bone) - Applies the current animation transform to the given bone. #### tickGlobal() - Called every tick for global keyframes (sounds, particles, etc.). #### hasFinishedAllAnimations() - Returns true when no animations are playing. #### playAnimation(String animation, double lerpIn, double lerpOut, double speed, boolean force) - Starts an animation and returns its IAnimationProperty, or null if it could not play. #### playAnimation(IAnimationProperty property, boolean force) - Starts an already-built property. #### isPlayingAnimation(String animation) - Returns whether the given animation is currently playing. #### stopAnimation(String animation) - Stops the animation gracefully, playing the lerp-out. #### forceStopAnimation(String animation) - Stops the animation immediately, skipping lerp-out. #### forceStopAllAnimations() - Stops all animations immediately. #### getAnimation(String animation) - Returns the IAnimationProperty for the given animation, or null if not found. #### getAnimations() - Returns an unordered, immutable map of all live animation properties. #### setDefaultProperty(DefaultProperty defaultProperty) - Sets the default property for a ModelState. #### getDefaultProperty(ModelState state) - Returns the default property for the given ModelState. ### Code Example ```java public class CustomAnimationHandler implements AnimationHandler { private final ActiveModel activeModel; public CustomAnimationHandler(ActiveModel activeModel) { this.activeModel = activeModel; } @Override public ActiveModel getActiveModel() { return activeModel; } @Override public String getId() { // Used as the registry key when the model is saved/loaded return "custom"; } @Override public void prepare() { // Called every tick before bones update; advance your animation state here } @Override public void updateBone(ModelBone bone) { // Apply the current animation transform onto the given bone } @Override public void tickGlobal() { // Called every tick for global keyframes (sounds, particles, etc.) } @Override public boolean hasFinishedAllAnimations() { // Return true when nothing is playing return false; } @Override public @Nullable IAnimationProperty playAnimation(String animation, double lerpIn, double lerpOut, double speed, boolean force) { // Start an animation; return its IAnimationProperty, or null if it could not play return null; } @Override public boolean playAnimation(IAnimationProperty property, boolean force) { // Start an already-built property return false; } @Override public boolean isPlayingAnimation(String animation) { return false; } @Override public void stopAnimation(String animation) { // Stop gracefully (play the lerp-out) } @Override public void forceStopAnimation(String animation) { // Stop immediately, skipping lerp-out } @Override public void forceStopAllAnimations() { } @Override public @Nullable IAnimationProperty getAnimation(String animation) { return null; } @Override public Map getAnimations() { // Unordered, immutable map of all live properties return Collections.emptyMap(); } @Override public void setDefaultProperty(DefaultProperty defaultProperty) { } @Override public DefaultProperty getDefaultProperty(ModelState state) { return null; } } ``` ``` -------------------------------- ### Launch a projectile from a model part Source: https://wiki.mythiccraft.io/modelengine/Skills/Targeters/ModelPart This example shows how to set the origin of a projectile to a specific bone location on a modeled entity using the modelpart targeter. ```yaml ExampleSkill: Skills: - projectile{ ...; origin=@modelpart{mid=your_model;pid=boneid;location=0,1,0}; fromorigin=true } @target ``` -------------------------------- ### Heal the model driver Source: https://wiki.mythiccraft.io/modelengine/Skills/Targeters/ModelDriver This example demonstrates a metaskill that heals the driver of the modeled entity when cast, provided the model has a driver. ```yaml ExampleSkill: Conditions: - modelhasdriver true Skills: - heal{a=10} @modeldriver ``` -------------------------------- ### Apply Change Part Mechanic Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/ChangePart Example showing the application of a model followed by the changepart mechanic to replace the left arm of the kindletronjr model with the left arm from the kindletronsr model. ```yaml ApplyModel: Skills: - model{mid=kindletronjr} @self - changepart{mid=kindletronjr;pid=left_arm;nmid=kindletronsr;npid=left_arm} @self ``` -------------------------------- ### Setting render scale of all models Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/Scale Example of using the scale mechanic to set the render scale to 2 for the targeted entity. ```yaml Skills: - scale{s=2} @self ``` -------------------------------- ### Binding a mob to a hitbox Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/BindHitbox Example configuration showing a boss entity spawning a model and binding a specific sub-hitbox to a secondary entity. ```yaml boss_turtle: Type: PIG Health: 100 - model{mid=big_turtle} @self ~onSpawn - bindHitbox{mid=big_turtle;p=ob_box_left_front_paw;t=boss_turtle_hitbox} @self ~onSpawn boss_turtle_hitbox: Type: PIG Health: 30 Options: NoAI: true Skills: - particles{p=reddust;a=4;vS=0.5;hS=0.5;y=0.5} @origin ~onDamaged - signal{s=paw_death} @parent ~onDeath ``` -------------------------------- ### Apply vertical billboard mode to a model part Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/Billboard This example demonstrates how to spawn a custom model and set its 'eyes' bone to a vertical billboard mode so it always faces the player. ```yaml Skills: - model{m=customSpider} @self ~onSpawn - billboard{p=eyes;b=VERTICAL} @self ~onSpawn ``` -------------------------------- ### MM Skill with Skill Parameters in Script Keyframe Source: https://wiki.mythiccraft.io/modelengine/Modeling/Scriptable-Keyframes Use skill parameters within keyframes by referencing them with . This example uses for the message text. ```yaml Primary_5: Skills: - message{m=;audience=world} @self - explode @ModelPart{m=dr_axis;p=attack_point} ``` -------------------------------- ### Configure Inverse Kinematics and Physics Source: https://wiki.mythiccraft.io/modelengine/API/Basic/Configure-Bone-Behavior Demonstrates configuring IK behavior for rope and physics bones, including setting targets, gravity, and damping. ```java ActiveModel model = ... model.getBone("rope_end").ifPresent(modelBone -> { modelBone.getBoneBehavior(BoneBehaviorTypes.IK).ifPresent(ik -> { ik.setTarget(entity, 1.2); }); }); model.getBone("lantern").ifPresent(modelBone -> { modelBone.getBoneBehavior(BoneBehaviorTypes.IK).ifPresent(ik -> { ik.setGravity(30); ik.setDamping(0.05f); }); }); ``` -------------------------------- ### Timeline operations Source: https://wiki.mythiccraft.io/modelengine/API/Advanced/Custom-Timeline Operations to check for, get, or create interpolators and keyframes by KeyframeType. ```APIDOC ## Timeline operations ### Description Operations to check for, get, or create interpolators and keyframes by KeyframeType. ### Method Methods ### Endpoint hasInterpolator(KeyframeType), getInterpolator(KeyframeType), getKeyframe(time, KeyframeType) ### Parameters - **KeyframeType** (KeyframeType) - Required - The type of keyframe (POSITION, ROTATION, SCALE, SCRIPT). - **time** (float) - Required - The time in seconds for the keyframe. ### Request Example ```java boolean has = timeline.hasInterpolator(KeyframeTypes.POSITION); KeyframeInterpolator interp = timeline.getInterpolator(KeyframeTypes.POSITION); VectorKeyframe frame = timeline.getKeyframe(0.0f, KeyframeTypes.POSITION); ``` ``` -------------------------------- ### Menu Command Source: https://wiki.mythiccraft.io/modelengine/Commands-and-Permissions Opens the model configuration menu. Available since R4.0.4. ```text /meg menu ``` -------------------------------- ### Petrify model on death Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/Petrify Example of using the petrify mechanic to turn a model into a statue when it dies. ```yaml Skills: - petrify{mid=examplemodel} @self ~onDeath ``` -------------------------------- ### Configure Single Bone Behavior Source: https://wiki.mythiccraft.io/modelengine/API/Basic/Configure-Bone-Behavior Demonstrates how to retrieve a specific bone by name and configure its HEAD behavior. ```java // Get a hold of the ActiveModel you want to modify ActiveModel model = ... // Search for a bone called "head" model.getBone("head").ifPresent(modelBone -> { // Get the HEAD behavior of this bone modelBone.getBoneBehavior(BoneBehaviorTypes.HEAD).ifPresent(head -> { // Configure the bone behavior head.setLocal(true); }); }); ``` -------------------------------- ### Hiding a specific bone Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/PartVisibility This example hides the right arm of the specified model upon spawning. ```yaml Skills: - model{m=test_model} @self ~onSpawn - partvis{m=test_model;p=right_arm} @self ~onSpawn ``` -------------------------------- ### HitboxIsSubHitbox Condition Usage Source: https://wiki.mythiccraft.io/modelengine/Skills/Conditions/HitboxIsSubHitbox Example of using the HitboxIsSubHitbox condition to check if 'mycustomhitbox' triggered the skill. ```yaml Conditions: - HitboxIsSubHitbox{hb=mycustomhitbox} true ``` -------------------------------- ### Basic Model Disguise Usage Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/ModelDisguise A basic example that turns a player into a worm when they are hurt, with the model visible to the player themselves. ```yaml Skills: - modeldisguise{m=worm;s=true} @self ~onHurt ``` -------------------------------- ### Create an IK chain and set a target Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/IKChain Configures a leg as an IK chain on spawn and sets the foot to track a target every 20 ticks. ```yaml Skills: - ikchain{root=leg_upper;tip=foot} @self ~onSpawn - iktarget{p=foot} @target ~onTimer:20 ``` -------------------------------- ### Configure Batch Bone Behavior Source: https://wiki.mythiccraft.io/modelengine/API/Basic/Configure-Bone-Behavior Demonstrates how to iterate through all bones in a model and apply an ITEM behavior to each. ```java // Get a hold of the ActiveModel you want to modify ActiveModel model = ... // Iterate through all bones on the model model.getBones().forEach((s, modelBone) -> { var provider = new HeldItem.StaticItemStackSupplier(new ItemStack(Material.CARVED_PUMPKIN)); // Get the ITEM behavior modelBone.getBoneBehavior(BoneBehaviorTypes.ITEM).ifPresent(heldItem -> { // Configure the bone behavior heldItem.setItemProvider(provider); }); }); ``` -------------------------------- ### Building an animation from timelines Source: https://wiki.mythiccraft.io/modelengine/API/Advanced/Custom-Timeline How to create a BlueprintAnimation, add a bone timeline, and set animation properties. ```APIDOC ## Building an animation from timelines ### Description How to create a BlueprintAnimation, add a bone timeline, and set animation properties. ### Method Methods ### Endpoint new BlueprintAnimation, getTimelines().put, setLength, setLoopMode, setOverride ### Parameters - **modelBlueprint** (ModelBlueprint) - Required - The model blueprint. - **name** (String) - Required - The animation name. - **boneUuid** (UUID) - Required - The UUID of the bone. - **length** (double) - Required - Length in seconds. - **loopMode** (LoopMode) - Required - One of ONCE, HOLD, LOOP. - **override** (boolean) - Required - Whether to override. ### Request Example ```java BlueprintAnimation animation = new BlueprintAnimation(modelBlueprint, "my_animation"); Timeline timeline = new Timeline(animation, false); // ... fill timeline via getKeyframe(...) as shown above ... animation.getTimelines().put(boneUuid, timeline); animation.setLength(2.0); animation.setLoopMode(BlueprintAnimation.LoopMode.LOOP); animation.setOverride(false); ``` ``` -------------------------------- ### Hide Modeled Entity to players in radius Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/PairModel This example hides the modeled entity from all players within a 10-block radius. ```yaml Skills: - pairmodel{hidden=true} @PIR{r=10} ``` -------------------------------- ### Creating a Dummy Source: https://wiki.mythiccraft.io/modelengine/API/Basic/Per-Player-Model Initializes a dummy entity, disables automatic spawning, and attaches a model to it. ```java Dummy dummy = new Dummy<>(); // The dummy will no longer spawn and despawn for players automatically dummy.setDetectingPlayers(false); ModeledEntity modeledEntity = ModelEngineAPI.createModeledEntity(dummy); ActiveModel activeModel = ModelEngineAPI.createActiveModel("test_model"); modeledEntity.addModel(activeModel, true); ``` -------------------------------- ### StateToggle mechanic usage Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/StateToggle Example of using the StateToggle mechanic on an interaction trigger to toggle the 'activated' animation state on a model. ```yaml Skills: - StateToggle{mid=ExampleModel;state=activated} @self ~onInteract ``` -------------------------------- ### Adding a model Source: https://wiki.mythiccraft.io/modelengine/API/Basic/Add-Remove-Model This snippet shows how to spawn an entity, create a ModeledEntity, create an ActiveModel, and add the model to the entity. ```APIDOC ## Adding a model ### Description Spawns a new entity, creates a ModeledEntity from it, creates an ActiveModel using the model ID, and adds the model to the entity. ### Code ```java // 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); ``` ``` -------------------------------- ### Creating a Dummy Source: https://wiki.mythiccraft.io/modelengine/API/Basic/Per-Player-Model Creates a Dummy instance, disables automatic player detection, and attaches an active model to a modeled entity. ```APIDOC ## Creating a Dummy ### Description Creates a Dummy instance, disables automatic player detection, and attaches an active model to a modeled entity. ### Code Example ```java Dummy dummy = new Dummy<>(); // The dummy will no longer spawn and despawn for players automatically dummy.setDetectingPlayers(false); ModeledEntity modeledEntity = ModelEngineAPI.createModeledEntity(dummy); ActiveModel activeModel = ModelEngineAPI.createActiveModel("test_model"); modeledEntity.addModel(activeModel, true); ``` ``` -------------------------------- ### Create a custom mount controller class Source: https://wiki.mythiccraft.io/modelengine/API/Advanced/Custom-Mount-Controller Implement a custom controller by extending AbstractMountController. The MountControllerType must be defined as a static field using a constructor reference to the class. ```java public class CustomMountController extends AbstractMountController { // Type class used to specify the controller when mounting entity // NEVER SUPPLY A STATIC INSTANCE public static final MountControllerType CUSTOM = new MountControllerType(CustomMountController::new); public CustomMountController(Entity entity, Mount mount) { super(entity, mount); } @Override public void updateDriverMovement(MoveController controller, ActiveModel model) { // Update function for driver } @Override public void updatePassengerMovement(MoveController controller, ActiveModel model) { // Update function for passengers } } ``` -------------------------------- ### SetItemModel mechanic usage Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/SetItemModel Example of applying the setitemmodel mechanic to a model bone using the meg prefix to avoid conflicts with Crucible. ```yaml Skills: - meg:setitemmodel{mid=testmodel;bone=examplebone;i=STONE} @self ``` -------------------------------- ### Lock rotation when attacking Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/LockModel This example locks the entity's rotation during an attack sequence to prevent drift, then unlocks it after the attack completes. ```yaml Skills: - skill{s=[ - cancelevent - skill{s=[ - state{s=attack} @self - lockmodel @self - delay 5 - damage{a=2;type=ATTACK} @EIC{r=3;a=180;conditions=[ - isPlayer{} true ]} - delay 10 - lockmodel{l=false} @self ];cooldown=1} ];sync=true} ~onAttack ``` -------------------------------- ### Tie rope to interacting player Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/IKTarget This example ties a rope end to a player upon interaction and unties it when the mob takes damage. ```yaml Skills: - iktarget{p=rope_end;y=1.2} @trigger ~onInteract - iktarget{p=rope_end;clear=true} @self ~onDamaged ``` -------------------------------- ### Configure arm IK with weight and blend ticks Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/IK Sets the arm to follow its null object at half strength (w=0.5) and blend to new targets over 10 ticks (bt=10). Applied on spawn. ```yaml Skills: - ik{p=arm_target;w=0.5;bt=10} @self ~onSpawn ``` -------------------------------- ### Using Meta Controller with mountmodel Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/MountModel Mounts the trigger to a model using a Meta Controller to mimic walking behavior. This configuration requires MythicMobs Premium and allows for custom movement and interaction logic. ```yaml Skills: - model{m=elk;usm=true;drive=true;ride=true;n=nametag} @self ~onSpawn - mountmodel{mode=[ - move{front=;side=} - meg:jump ?variableEquals{var=skill.meg:jump;value=1} ?variableEquals{var=skill.meg:on_ground;value=1} - dismountmodel @trigger ?variableEquals{var=skill.meg:sneak;value=1} - actionmessage{m= } @trigger ]} @trigger ~onInteract ``` -------------------------------- ### Hitbox Condition Usage Source: https://wiki.mythiccraft.io/modelengine/Skills/Conditions/Hitbox Example of using the hitbox condition within a conditions block to check for a specific hitbox named 'mycustomhitbox'. ```yaml Conditions: - hitbox{hb=mycustomhitbox} true ``` -------------------------------- ### Heal passengers at specific seats Source: https://wiki.mythiccraft.io/modelengine/Skills/Targeters/ModelPassengers This example demonstrates using the modelpassengers targeter to heal players seated at 'seat1' or 'seat3' on a model with the ID 'your_model'. ```yaml ExampleSkill1: Skills: - skill:ExampleSkill2 @modelpassengers{mid=your_model;p=seat1,seat3} ExampleSkill2: TargetConditions: - isPlayer true Skills: - heal{a=10} ``` -------------------------------- ### Implementing a BlockbenchBehaviorParser Source: https://wiki.mythiccraft.io/modelengine/API/Advanced/Custom-Bone-Behaviors Create a parser by implementing BlockbenchBehaviorParser to define how configuration is read from the .bbmodel file. The processBone method allows attaching behaviors to specific bones based on their names. ```java public class GlowBehaviorParser implements BlockbenchBehaviorParser { @Override public void processModel(ErrorCollector collector, BlockbenchModel model, ModelBlueprint blueprint) { // Optional: whole-model parsing. Leave empty if unused. } @Override public void processBone(ErrorCollector collector, BlockbenchModel model, BlockbenchModel.Group group, BlueprintBone bone) { // Attach the "glow" behavior to bones whose name starts with "glow_" if (bone.getName().startsWith("glow_")) { var options = new HashMap(); options.put("enabled", true); bone.getBehaviors().put("glow", options); } } } ``` -------------------------------- ### Restrict head rotation to pitch only Source: https://wiki.mythiccraft.io/modelengine/Skills/Mechanics/LockModelHead This example demonstrates how to lock the yaw of a model's head while keeping the pitch unlocked, preventing sideways movement. ```yaml Skills: - lockmodelhead{mid=examplemodel;lockyaw=true;lockpitch=false} @self ~onSpawn ``` -------------------------------- ### Adding a model to an entity Source: https://wiki.mythiccraft.io/modelengine/API/Basic/Add-Remove-Model Demonstrates how to spawn an entity, create a ModeledEntity, and attach an ActiveModel to it using the ModelEngineAPI. ```java // 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); ```