LogoArcartX Doc
简单功能篇

物品额外渲染

ItemEffect 物品额外渲染配置

物品额外渲染

物品额外渲染(ItemEffect)可以根据物品的 NBT 标签匹配,在物品图标上叠加额外的渲染图层。常见用途包括品质边框、稀有度光效等。

配置文件位于服务端 plugins/ArcartX/item_effect/ 目录下,支持创建多个 yml 文件和子目录。

配置格式

示例:
  # NBT 匹配键,支持多级路径(用 . 分隔)
  matchKey: "品质"
  # NBT 匹配值(忽略大小写)
  matchValue: "传说"
  # 是否在物品图标之前渲染(默认 false,即渲染在物品之上)
  before: false
  # 渲染属性
  attribute:
    w: 16        # 宽度
    h: 16        # 高度
    x: 0         # X 偏移
    y: 0         # Y 偏移
    path: "item/legendary.png"  # 资源路径

字段说明

字段类型默认值说明
matchKeystring""NBT 匹配键,支持多级路径如 display.Name
matchValuestring""NBT 匹配值,忽略大小写
beforebooleanfalse为 true 时渲染在物品图标之前(作为底层),为 false 时渲染在物品图标之上(作为覆盖层)
attribute.wnumber16渲染宽度
attribute.hnumber16渲染高度
attribute.xnumber0X 轴偏移
attribute.ynumber0Y 轴偏移
attribute.pathstring""贴图资源路径

在 UI 中,物品图标的渲染尺寸为 16×16,所以铺满整个物品背景的 ItemEffect 应设置为 16×16。

使用示例

为"传说"品质的物品添加金色边框:

传说边框:
  matchKey: "品质"
  matchValue: "传说"
  before: false
  attribute:
    w: 16
    h: 16
    x: 0
    y: 0
    path: "item/legendary_border.png"

为所有物品添加底层背景(渲染在物品之前):

物品底色:
  matchKey: "品质"
  matchValue: "传说"
  before: true
  attribute:
    w: 16
    h: 16
    x: 0
    y: 0
    path: "item/legendary_bg.png"

On this page