ShadowUI 使用文档

八类原生模型配置的完整示例

Minecraft 1.12.2 · Forge / Bukkit
本页目录

这些配置直接取自当前源码默认资源,不含省略号。首次启动时 ModelConfigManager 在原生 configs 下生成相应文件;已存在文件不能假定会被新版本自动覆盖。服务端规则和客户端资源是两件事:除内置标准玩家骨骼外,示例中的 skeleton_king、shadow_blade、boss_aura 等都需要真实对应资源,不是下载链接,也不是已经附带的素材。

目录与消费路径

插件数据目录下的文件 内容 额外准备
configs/player/skeletons.yml 标准玩家骨骼与挂点 standard.geo.bbmodel 兼容映射内置 default_player;player_skin 使用玩家皮肤
configs/entity/models.yml 实体/Mythic 条件绑定 skeleton_king 模型、贴图及实际 Mythic 内部 ID
configs/item/models.yml 物品匹配与手持/装备外观 shadow_blade 等模型及贴图;物品条件必须与服务器物品一致
configs/item/block-skulls.yml 头颅方块模型 对应模型资源和合法方块场景
configs/misc/tooltips.yml Tooltip 展示 配套组件/图片/文字与触发物品
configs/effect/effects.yml 实体/位置效果 粒子或模型资源;跟随和生命周期按配置验证
configs/effect/bedrock-particles.yml 基岩粒子定义 对应粒子 JSON 与贴图
configs/animation/animations.yml 动画/玩家动作绑定 模型中真实动画名、玩家骨骼与限定 ID

写入/修改后执行 /shadowmodelconfig reload;用 status、debug documentId 和 debug resources documentId 分别核对加载、来源、资源。没有一个“所有功能自动播放”的开关,模型绑定和技能触发仍需要匹配或 API/Mythic 提供者。

1. 内置标准玩家骨骼:首先验证这一份

默认规则匹配所有玩家,适合受控测试服的模型链检查;请先评估全员外观影响再用于生产。不要同时给同一玩家叠加多套替换规则。

YAML
schemaVersion: 1
entries:
  standard_player_skeleton:
    # 开箱即用的参考规则:匹配所有玩家,便于确认客户端骨骼替换链路。
    # standard.geo.bbmodel 会兼容解析为客户端内置 default_player.bbmodel,无需资源包重复提供。
    kind: player-skeleton
    priority: 0
    modelId: standard_player
    modelResource: models/player/standard.geo.bbmodel
    texture: player_skin
    # 完整人形固定替换原版;调试命令可用 mode=overlay 强制作为外观层显示。
    renderMode: replace
    syncMode: biped
    viewerRange: 64
    match:
      playerNameContains: ""
    boneMap:
      head: head
      body: body
      rightArm: rightArm
      leftArm: leftArm
      rightLeg: rightLeg
      leftLeg: leftLeg
      rightItem: rightItem
      leftItem: leftItem
      rightItemLocator: rightitemlocator
      leftItemLocator: leftitemlocator
    heldItems:
      mainhand:
        # The locator gives the grip its position; its conversion into vanilla's
        # item frame is measured from this skeleton's rest pose, so no hand-tuned
        # calibration transform belongs here.
        bone: rightitemlocator
      offhand:
        bone: leftitemlocator

预期观察是玩家身体替换、皮肤与 heldItems 挂点保持正确;必须分别看站立、走动、主手/副手、第一/第三人称和卸载回退。仅有 reload 日志或 bind ACK 不证明动作与握持正确。

2. 实体模型绑定

YAML
schemaVersion: 1
entries:
  skeleton_king_exact:
    kind: model
    priority: 100
    modelId: skeleton_king
    modelResource: bbmodel/models/skeleton_king.bbmodel
    texture: bbmodel/textures/skeleton_king.png
    match:
      mythicType: SkeletonKing
    spawnAction: idle
    deathAction: death
    deathTicks: 20
    viewerRange: 64
  shadow_named_mob_fuzzy:
    kind: model
    priority: 10
    modelId: skeleton_king
    match:
      entityNameContains: Shadow
    defaultAction: idle
    viewerRange: 48

准备模型/贴图后再生成对应实体。mythicType 使用内部怪物 ID,不是显示名;priority 区分精确规则和较弱的名字匹配。spawnAction/deathAction 必须是资源中的真实动作。MythicMobs mechanic 与支持版本见Mythic 接入。

3. 物品模型绑定

YAML
schemaVersion: 1
entries:
  shadow_blade:
    kind: model
    priority: 10
    condition:
      item: minecraft:diamond_sword
      metadata: -1
      displayNameContains: Shadow
    renderer: bbmodel
    weaponFashion: true
    modelId: shadow_blade
    mainHandBone: right_hand
    offHandBone: left_hand
    transform:
      scale: 1.0
      offset: [0.0, 0.0, 0.0]
      rotation: [0.0, 0.0, 0.0]

先核对 item 注册名、metadata 和显示名;再分别观察背包图标、地上物品、主手、副手。不同 renderer 与内置几何物品有不同兼容边界,不能只凭背包图标正确宣称手持正确;详细参数见模型配置。

4. 头颅方块

YAML
schemaVersion: 1
entries:
  skull_relic:
    kind: block-skull
    priority: 10
    textureHash: replace_with_texture_value_or_hash_fragment
    modelId: skull_relic
    renderer: bbmodel
    # 1: 仅在玩家视角内渲染;2: 全局渲染(已加载区块内不受视锥剔除)
    renderMode: 1
    transform:
      scale: 1.0
      offset: [0.0, 0.0, 0.0]
      rotation: [0.0, 0.0, 0.0]
    events:
      interact: true
      click: true
      spawn: true
      destroy: true

把配置 ID、方块位置与实际业务放置/解除操作一起核对。服务端的世界方块状态仍需以 API 放置结果与业务权限判断,客户端模型显示不是放置成功证明。

5. Tooltip

YAML
schemaVersion: 1
entries: {}

分别验证匹配物品与不匹配物品;检查文字换行、图片与变量来源。模板中引用的外部资源需真实准备,不能把空白误判为组件布局错误。

6. 效果

YAML
schemaVersion: 1
entries:
  boss_aura_effect:
    kind: effect
    type: bedrock_particle
    resource: shadowui:boss_aura
    targetType: entity
    lifetimeTicks: 200
    followView: true
    transform:
      scale: 1.0
      offset: [0.0, 1.0, 0.0]
  boss_orbit_model:
    kind: effect
    type: bbmodel
    resource: skeleton_king
    targetType: entity
    lifetimeTicks: 200
    bone: rightShoulder
    transform:
      scale: 1.0
      offset: [0.3, 0.0, 0.0]

effect 条目与一次效果实例不是同一 ID。需要明确目标为实体还是位置、持续时间和跟随行为;单次动作结束无 idle 的模型效果、持续循环与重播行为在模型配置和服务端 API中说明。

7. 基岩粒子

YAML
schemaVersion: 1
entries:
  boss_aura:
    kind: bedrock-particle
    identifier: shadowui:boss_aura
    resource: particles/bedrock/boss_aura.json
    targetType: entity
    loop: true
    lifetimeTicks: 200
    scale: 1.0

缺粒子 JSON/纹理时先处理资源,而不是扩大粒子预算。实例数量、粒子计数或 handler ACK 不能替代真正可见的粒子、定位与到期消失验证。

8. 动画与动作绑定

YAML
schemaVersion: 1
entries:
  player_basic:
    kind: animation
    modelId: custom_player
    actions:
      idle:
        loop: true
        source: bbmodel animation named idle
      walk:
        loop: true
        source: auto player limb swing
      run:
        loop: true
        speed: 1.25
        source: auto player sprint
      sneak:
        loop: true
        source: auto player sneak
      attack:
        loop: false
        source: server override or player swing
      death:
        loop: false
        source: auto player health state
  boss_actions:
    kind: animation
    modelId: skeleton_king
    actions:
      idle:
        loop: true
      attack:
        loop: false
      death:
        loop: false

按真实动作源检查条目 ID、动作名、循环、速度与范围;需要限定名时使用当前文档的 entry@action 规则,不把旧版本的裸动作名兼容当作所有资源都支持。声音接入见模型声音。本页尚无实拍,不宣称完整动作/粒子/外观回归已完成。