ShadowUI 使用文档

Item-backed appearances (model schema 35)

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

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

Decision: ADR-050(源码配套资料). Capability: model_item_appearances_v35, together with the existing appearance ownership and declared item/equipment backend requirements. Existing AW definitions retain schema 33/34.

Display declarations

An appearances entry uses the existing immutable id and player UUID target. order is an integer in -100000..100000. Higher order wins for a slot; an equal order for the same player/slot is rejected. Different players, hands and slots are independent. Up to 16 declarations per plan and 128 per client session remain the existing limits.

JSON
{
  "id": "held",
  "target": {"kind": "player", "uuid": "00000000-0000-0000-0000-000000000001"},
  "renderer": "item",
  "order": 0,
  "slot": "mainhand",
  "item": {"id": "minecraft:stick", "count": 1},
  "profile": {"renderer": "gltf", "resource": "example:models/item.glb"}
}

item uses mainhand or offhand; physical left/right follows the player's main-arm preference. Its profile uses the existing ItemModelBinding grammar: gltf, java_item, aw, source_item or icon. Each entry owns its own prepared backend; it does not register a global item selector or change the appearance of matching real items in inventories, frames or drops. Context-disabled views keep the declared display item's native rendering. A filled map is rejected because it has a separate two-hand path.

For worn equipment, use renderer: equipment, slot: head|chest|legs|feet, a display item renderable in that exact native slot, and a string profile referencing an existing .armor.json or .bonearmor.json profile. For example, an iron helmet display item with example:profiles/hat.bonearmor.json. Native item components are decoded before commit; unknown data, unavailable resources and profile-slot mismatches reject the candidate. Source skeleton armor profiles are a separate pending R4 backend, not accepted through the item renderer.

Display item accepts id, optional count (1..99, default 1) and native components data. Air is invalid. Components are at most 16 KiB, 16 levels and 1024 nodes; component keys are namespaced. Native codecs validate the meaning. These values are visual inputs and never replace server inventory facts.

Public/configured lifecycle

Use AppearanceBinding.item(...) / AppearanceBinding.equipment(...), then the existing ModelService.Owner.bindAppearance, patchAppearance, unbindAppearance, appearance, observe and status. Profile configuration and model:appearance_bind/patch/unbind use the same DTO and transaction. Existing configured model:clear releases only that profile's declarations.

Patches may replace order, slot, item or profile. ID, player and renderer are immutable. item and profile are complete replacements; untouched data references remain in the template. AW-only fields are rejected for item-backed declarations. Missing bound data suspends the profile's complete model domain, following the existing model v2 transaction; independent service owners remain active. Restoring data re-prepares the profile domain.

Resources and display stacks are prepared privately, then committed under the existing session/revision/resource-generation fences. Failure retains the old applied receipt. A higher-priority owner can hide a lower-priority appearance; removing it reveals the still-owned lower-priority declaration. Unbinding the last appearance restores ordinary native display. No native stack is written, no item count is authoritative, and the framework grants no gameplay action or permission.

Migration and completion

V1 weaponFashion, automatic slot inference and equal-order declaration order require explicit conversion. R5 must preserve equivalent selection or produce a field-specific blocking report. Remaining format/view combinations, cross-server transfer, native acceptance, user acceptance and release retain separate ledger statuses.