Tinkers' Schema

模组

· 作者 moos2333

使用 JSON 为 Tinkers' Construct 2 自定义工具进行数据驱动的注册,无需 Java。

0 本站下载 0 关注 更新于 10 小时前

需要前置:Tinkers' Construct、Mantle

最新 0.4.0 · 1.12.2 · Forge

一键开服(送7天)

Tinkers' Schema

一个面向 Tinkers' Construct 2 的数据驱动注册框架。 通过 JSON 文件添加自定义近战武器、采矿工具、弓、投掷武器和弹药——无需 Java,无需编译。

Tinkers' Schema 本身不会添加任何物品。它仅根据配置文件描述的内容进行注册,因此你需要使用下方的示例整合包,或者准备自己的 JSON 文件和资源资产,否则游戏中不会出现任何东西。为了加载自定义模型和纹理,推荐使用 Resource Loader。

开箱即用的示例整合包:Tinkers' Schema - Example Tools​

要求

  • Minecraft 1.12.2 + Forge
  • Tinkers' Construct 2
  • Mantle
  • Resource Loader —— 推荐,允许你将资产放入 .minecraft/resources/

工具类型

tooltype 基于 获得内容
sword SwordCore 近战武器,横扫攻击
harvest AoeToolCore 可配置范围的采矿工具
bow BowCore 拉弦发射器
thrown ProjectileCore 投掷武器,耐久度即为弹药量
ammo ProjectileCore 独立弹药,无法用手投掷

每种类型都是真实的 Tinkers' 物品:可在工具站或锻造台制作、修复、修改,并根据材质着不同颜色。

快速入门

1. 将配置文件放入 config/tinkersschema/tools/。

一个最简近战武器:

{
  "id": "mymod:war_club",
  "tooltype": "sword",
  "parts": [
    { "type": "handle", "item": "tconstruct:tool_rod" },
    { "type": "head",   "item": "tconstruct:sword_blade" }
  ],
  "repairParts": [1],
  "traits": ["splintering"],
  "guiSlots": ["center", "topright"]
}

一个最简采矿工具。effectiveMaterials 对于 harvest 是必填项 —— 如果没有它,该工具无法挖掘任何方块:

{
  "id": "mymod:pickaxe",
  "tooltype": "harvest",
  "effectiveMaterials": ["ROCK", "WOOD", "GROUND"],
  "harvestToolClass": "pickaxe",
  "aoeRange": [1, 1, 1],
  "parts": [
    { "type": "handle", "item": "tconstruct:tool_rod" },
    { "type": "head",   "item": "tconstruct:pickaxe_head" }
  ],
  "repairParts": [1],
  "guiSlots": ["center", "topright"]
}

2. 添加模型、纹理和名称。

.minecraft/
├── config/tinkersschema/tools/
│   └── pickaxe.json
└── resources/mymod/                          ← Resource Loader,或资源包
    ├── models/item/tools/pickaxe.tcon.json
    ├── models/item/tools/pickaxe.mod.json    ← 可选,修饰符叠加层
    ├── textures/items/tools/pickaxe/
    │   ├── handle.png                        ← 16×16 灰度图
    │   └── head.png
    └── lang/en_us.lang

pickaxe.tcon.json —— 每个部件一层,按 parts 顺序排列。brokenN 是耐久度为零时显示的纹理:

{
  "loader": "tconstruct:tool",
  "parent": "forge:item/default",
  "textures": {
    "layer0": "mymod:items/tools/pickaxe/handle",
    "layer1": "mymod:items/tools/pickaxe/head",
    "broken1": "mymod:items/tools/pickaxe/head_broken"
  }
}

lang/en_us.lang:

item.mymod.pickaxe.name=Pickaxe
item.mymod.pickaxe.desc=One block at a time.

3. 重启游戏。 工具会出现在工具站和 Tinkers' Construct 创造模式标签页中。缺少模型的工具仍然可以工作,但会渲染为缺失纹理的方块。

修饰符叠加层

Tinkers' Construct 根据工具名称索引其叠加层纹理,并且只认识它自己的工具,因此自定义工具名称永远不会匹配。请在模型旁边提供一个映射表:

models/item/tools/pickaxe.mod.json

{
  "textures": {
    "sharpness": "tconstruct:items/pickaxe/mod_sharpness",
    "diamond":   "tconstruct:items/pickaxe/mod_diamond"
  }
}

键是修饰符 ID,必须完全匹配。值是在工具上方绘制的叠加层纹理,因此请重用你的模型所基于的原版工具的叠加层,以保持 UV 布局对齐。未列出的修饰符 simply 渲染时无叠加层——无错误,无缺失部分。该文件在模型烘焙时读取一次。

参考

公共字段

Field Default Notes
id required namespace:path
tooltype required see table above
parts required ordered list of { "type", "item" }
station table table = Tool Station + Tool Forge, forge = Tool Forge only
categories type default TOOL, WEAPON, HARVEST, AOE, LAUNCHER, PROJECTILE, NO_MELEE
traits [] intrinsic trait IDs, e.g. splintering, beheading
traitColors {} per-trait display color, e.g. {"splintering": "yellow"}
guiSlots preset grid topleft … bottomright, or "12,62"; freely mixed
modifiers material total number of modifier slots
repairParts [1] indices of parts used for repair
repairModifiers {} repair multiplier per part index
stats Tinkers' baseline see below

Part type accepts head, handle, extra, bowlimb, bowstring, arrowhead, arrowshaft, fletching, any registered stat ID, or a comma-separated combination. The same type may appear more than once.

属性

damagePotential 1.0 · attackSpeed 1.6 · knockback 1.0 · bonusAttack 0.0 · attackMultiplier 1.0 · durabilityMultiplier 1.0 · miningSpeedModifier 1.0 · damageCutoff 15.0 · repairModifier 1.0

远程相关字段

字段 适用对象 默认值 备注
ammo bow vanilla arrows + this mod's ammo 显式弹药物品 ID
crosshair bow SQUARE X, INVERSE, PLUS, T, SQUARE
projectile thrown, ammo shuriken shuriken, arrow, bolt
throwSpeed thrown 2.1 发射速度
cooldown thrown 4 投掷间隔(刻)
durabilityPerAmmo thrown, ammo 10 每次射击消耗的耐久度

在通用属性之上,弓还会添加以下统计属性:drawSpeedMultiplier、rangeMultiplier、bonusDamageMultiplier、baseProjectileDamage、projectileDamageModifier、baseInaccuracy、projectileSpeedMultiplier、drawMoveSpeed —— 所有乘数默认值为 1.0(加法伤害为 0.0),若省略 drawMoveSpeed 则保留原版拉弓时的移动减速效果。

采集相关字段

effectiveMaterials(必填)—— 工具可开采的方块材质:ROCK、WOOD、GROUND、SAND、IRON、LEAVES、PLANTS、SNOW、CLAY、GLASS 及其他原版方块材质。 harvestToolClass —— pickaxe、axe、shovel、null。 aoeRange —— [width, height, depth],[1, 1, 1] 表示单个方块。

限制

  • 工具行为(横扫、AOE 逻辑、拉弓机制)源自 Tinkers' Construct 的基础类,除上述字段外不可配置。
  • 模型路径由 Tinkers' Construct 加载器的约定固定:models/item/tools/<name>.tcon.json。
  • 原版 Tinkers' Construct 的弓无法识别本模组添加的弹药;自定义弓则可以自动识别。
  • 配置文件更改需要重启游戏才能生效。

许可与致谢

MIT 协议。基于 ForgeDevEnv(MIT 协议,CleanroomMC)构建。 Tinkers' Construct 2 — SlimeKnights · Resource Loader — Lumien231 · ForgeDevEnv — CleanroomMC

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源