Model effect bone attachments v30
本页目录
本文对应 1.21.10 现代框架。文档中的接口与配置按当前文档快照核对;完整框架仍在开发验收。接口可编译、配置可解析与游戏内效果验证分别记录。
See ADR-042(源码配套资料). Model schema 30 and capability model_effect_attachments_v30 add an optional field to an owned effect:
"attachment": {"binding": "body", "node": "rightArm"}
body is an entity or player model binding in the same owner plan. Its native UUID must equal the effect target UUID. node is an exact, unambiguous node of that parent's resource. Parent and child may use different GLB/BBModel/Bedrock backends. A missing parent, wrong target/kind or unknown node fails before replacing the active plan. Use Owner.replace for atomic parent/child edits; unbind dependent effects before their parent. Ordinary bindEffect, patchEffect and profile model configuration/actions remain the public entry points. attachment: null clears the optional field; other partial/invalid objects fail.
The effect borrows the actual rendered parent pose, with no extra animation clock. Its origin follows the bone, including the parent's transform and authored translation. Orientation uses normalized bone basis columns, matching V1; the child's offset, Y/X/Z rotation and scale are then applied once. placement.anchor, followYaw and followPitch are superseded by the bone frame. followX/Y/Z, first-person visibility and render range continue to apply. Attachment changes recapture held axes and preserve effect playback/lifetime. The parent bone's scale affects its location, but does not multiply the child's scale.
Frames expire after two existing client ticks and cannot cross actor/runtime/resource/world/owner boundaries. A temporarily invisible/unrendered/unloaded parent suspends the attachment until another valid frame exists; it never jumps to the origin or guesses a bone from its name. Animation/lifetime still follow the existing effect contract. Geometry, attached sounds and particles use the same resolved frame. Closing the owner or clear releases derived frames with existing model resources.
Absent/null attachments retain pre-v30 canonical bytes and constructors through the eleven-argument form. V1 heuristic fallback is intentionally an explicit R5 migration difference; converters must report it and require an authored fallback/offset choice. This slice does not declare all V1 effects or all player viewing contexts complete.