// Get a hold of the ActiveModel you want to modifyActiveModel 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
// Get a hold of the ActiveModel you want to modifyActiveModel model = ...// Iterate through all bones on the modelmodel.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); });});