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
  • Configure Bone Behavior

Configure Bone Behavior · Changes

Page history
Basic API usage authored Sep 29, 2023 by Ticxo's avatar Ticxo
Hide whitespace changes
Inline Side-by-side
Showing with 30 additions and 1 deletion
+30 -1
  • API/Basic/Configure-Bone-Behavior.md API/Basic/Configure-Bone-Behavior.md +30 -1
  • No files found.
API/Basic/Configure-Bone-Behavior.md
View page @ 0a25cf62
WIP ## Single modification
\ No newline at end of file
```<placeholder>
// 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);
});
});
```
## Batch modification
```<placeholder>
// 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);
});
});
```
\ No newline at end of file
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