Source-item authored events v20
本页目录
本文对应 1.21.10 现代框架。文档中的接口与配置按当前文档快照核对;完整框架仍在开发验收。接口可编译、配置可解析与游戏内效果验证分别记录。
Decision: ADR-032(源码配套资料). Parent: source items v5, item actions v17.
A source_item profile may declare "authoredEvents": true. ModelPlan then requires schema 20 and model_item_events_v20. The field is a strict boolean and supported only by typed BBModel/Bedrock source-item backends. Omitted/false preserves the earlier schema and behavior; existing plans are not rewritten. GUI previews, including v18 animation, stay silent.
The event formats, strict compilation and resource limits match block events v12. Exact clip names feed default playback, v17 action/queue/parallel playback and transitions. Only accepted pose facts are observed. No Java objects, reflection, custom files/network, arbitrary timeline instructions or gameplay mutation are exposed.
Events belong to each actually drawn native actor and physical item slot: left arm, right arm, head, ground or fixed. First/third-person views share an arm slot. Native stack visual copies do not multiply events. A binding's existing animation clock is shared as before, but each occurrence owns its event cursor and effects. The first accepted copy in a world tick supplies its root/node frame. Frames are captured from actual native submission and successful nonempty draw, with resource generation, action epoch and world checks. GUI and entity-preview passes have no world scope and cannot emit.
Sound follows the captured item root. Particle locators follow exact decoded source nodes in the same sampled frame, including configured transforms, native item display and parent transforms. First-person frames include native camera orientation and hand/bob transforms; hand and world particles use different projections, so identical screen pixels are not promised. No absent anchor falls back to world zero or a different actor.
Limits: 128 occurrences and 128 extracted pose snapshots per binding (old snapshots are retired on eviction or after two ticks), retirement after 600 idle ticks, effects suspended after more than two ticks without a successful draw, 256 item-event dispatch attempts per client tick, plus v12 table and existing sound/particle limits. Resource accounting includes compiled tables, retained occurrence frames and extracted node snapshots. Removed actors, action replacement, owner unload, level/session change, resource invalidation and clear release event groups and borrowed anchors. Failed preparation keeps the prior committed owner plan. Data-only updates preserve existing runtime identity.
Use the existing public model owner bind/patch/query, PresentationProfile domain, typed data bindings and model:item_* script primitives. No additional private wire command is required. Consumers keep inventory and gameplay facts authoritative. Diagnostics record actor/slot, admitted events, failures, freshness, root/node frames and actual source draw provenance; dispatch counts alone are not audio or particle rendering acceptance.
Implementation and native status are recorded only in R4 itemEventsSlice; R5 migration and final release remain separate.