ShadowUI 使用文档

Source-item GUI animation v18

状态待核对Minecraft 1.21.10 · Forge / Bukkit
本页目录

本文对应 1.21.10 现代框架。文档中的接口与配置按当前文档快照核对;完整框架仍在开发验收。接口可编译、配置可解析与游戏内效果验证分别记录。

Decision(源码配套资料). Progress and evidence: R4 itemGuiAnimationSlice in the delivery ledger.

ItemModelBinding source profiles accept an optional guiAnimation:

JSON
{
  "renderer": "source_item",
  "resource": "example:models/block-view-bb.model.json",
  "clip": "idle",
  "guiAnimation": { "clip": "rise", "loop": true, "speed": 0.25 }
}

The GUI clip is required, exact, nonempty, at most 240 characters, and cannot contain control characters. loop defaults to true; speed defaults to 1 and must be finite in (0,16]. Unknown fields, nulls and simultaneous guiIcon are rejected. Other renderers do not accept this field. ModelPlan selects schema 18 and requires model_item_gui_animation_v18 plus existing capabilities. Schema 17 does not exist. PresentationProfile must declare all requirements; data references and model:item_patch use the same validation.

GUI animation has private expression state and a clock starting when the view is prepared, including resource recovery. Reopening a GUI does not restart it. Loop false clamps to the final pose. Other item contexts use clip and v17 commands; those commands do not restart or change GUI playback. No authored sound/particle events are emitted by this preview. A rule's GUI displays share its private timeline, independent of other owners and rules using the same asset.

Rest bounds determine the existing XY fit and centering; animated bounds only determine render extents. The model must keep changing geometry inside its intended icon layout. autoFitGui, transforms, visibility and disabled views preserve their existing meanings. Without guiAnimation, ordinary rest/icon behavior and schema 2–16 digests are unchanged.

Missing clips or failed initial evaluation reject the prepared owner candidate and retain the previous valid owner plan. The extra pose is accounted before allocation and during transient action replacement. Profile changes prepare a new view; selector-only changes preserve the existing view. Resource invalidation, owner close, clear and disconnect retire the view and queued render submissions. Data-binding suspension follows the existing profile contract and releases its view until valid data returns.

Diagnostics under sourceItem.draws.GUI record actual submitted guiAnimation, selected clip, elapsed time, geometry checksum, generation and vertex count. actionActive remains false for GUI draws. These observations are evidence of native submission; public receipt alone does not prove rendering.

V1 conversion must resolve preview aliases against the source asset and report missing/ambiguous aliases. Current visible-rest fitting differs from V1's bounds measured before temporary hitbox hiding; outer skull GUI/held placement also remains a separate migration requirement. No silent conversion is authorized by this API.