Model effect placement v28
本页目录
本文对应 1.21.10 现代框架。文档中的接口与配置按当前文档快照核对;完整框架仍在开发验收。接口可编译、配置可解析与游戏内效果验证分别记录。
See ADR-040(源码配套资料). Owner methods bindEffect, patchEffect, replace, effect and the existing profile model:effect_* primitives accept the optional placement value. Public types contain no Minecraft or Bukkit objects.
{
"placement": {
"anchor": "eyes",
"followX": true,
"followY": true,
"followZ": false,
"followYaw": true,
"followPitch": false,
"firstPersonVisible": false,
"renderRange": 48
}
}
Defaults: feet, all XYZ follow enabled, yaw/pitch disabled, first-person visible, range 0. Missing/default placement retains prior canonical bytes and schema. Any nondefault policy requires model_effect_placement_v28 and schema 28. placement: {} restores defaults; null and unknown fields fail. A patch replaces the entire placement value, while transform vectors retain their existing independent merge behavior. Fixed-point targets accept only the range option.
Feet uses interpolated native feet position; center adds half native height; eyes adds native eye height, with V1's 0.85-height fallback when unavailable. Disabled XYZ axes retain the first resolved anchor coordinate. Anchor-mode changes recapture; moving or toggling other policy fields does not reset the animation, program, delay, lifetime or frozen coordinates. Negative entity yaw and positive entity pitch precede local offset and consumer rotation/scale. Existing sound and particle origins use that same frame.
firstPersonVisible: false hides only an effect targeting the local player while that client uses first-person view. Other observers and third-person view remain eligible. renderRange is finite 0..128, measured from the resolved anchor before consumer offset to the native camera entity. Zero uses the existing renderer ceiling; the renderer still caps final camera-relative placement at 128 blocks. Filtering does not suspend animation or cancel its events.
Owner/session/revision/resource fencing, current prepare/commit/rollback and resource budgets are unchanged. Same-world resource recovery retains pure initial coordinates. Actual target or world replacement clears them, and default loop recovery follows v25–v27. Failed candidates retain the committed policy and runtime. Diagnostics retain visible as active lifecycle eligibility and add renderable for the latest native frame's spatial filter; placement and actualDraws remain actual GPU observations and may be older when hidden.
Old eight- and nine-argument constructors remain. The Java record gains a component: reflective component consumers and record patterns must adapt. Absent placement behaves exactly as before, including the modern world-oriented default. V1 migration must explicitly map anchorMode, XYZ flags, OR-combined yaw/pitch flags and visibility/range, including the old default yaw. Texture-only followView, bone anchors and unsupported range values must be reported separately; this API is not proof that the migration tool is complete.
Recovery capture includes the native target ID and a local world generation. Neither retains a native object. A checkpoint saved while resources are unavailable cannot restore coordinates after a world change, and a replacement native target ID recaptures its own origin.