Pufferfish 的技能库存负重
Pufferfish 的技能库存负重是一个服务端附加组件,它将 MT Inventory Weight 与 Pufferfish's Skills 连接起来。
它允许玩家的技能进度以两种方式增加其最大库存负重容量:
- 属性奖励(数据驱动) — 一个技能节点直接授予库存负重属性。无需 Java;这是捆绑的“携带”树的工作方式。
- Java 事件连接器 — 该附加组件读取技能类别的经验等级,并通过 MT Inventory Weight 的事件修改最大负重。
它还附带了一个可选的内置“携带”技能树,你可以在每个世界中启用它。
此模组不是独立运行的。
MT Inventory Weight 注册了一个原版的属性:
inventoryweight:generic.max_weight
Pufferfish's Skills 可以通过其 puffish_skills:attribute 奖励授予任何已注册的属性,因此技能节点可以直接授予最大负重。
1. 属性奖励(数据驱动,无需 Java)
在类别的 definitions.json 中,技能定义列出了奖励。将 puffish_skills:attribute 奖励指向 inventoryweight:generic.max_weight:
{
"type": "puffish_skills:attribute",
"data": {
"attribute": "inventoryweight:generic.max_weight",
"value": 200.0,
"operation": "addition"
}
}
operation |
效果 |
addition / add / add_value |
固定增加值(例如 +200)。推荐。 |
multiply_base / add_multiplied_base |
增加属性基值的一部分。 |
multiply_total / add_multiplied_total |
乘以当前总和。 |
优先使用 addition。如果属性基值为 0,multiply_* 操作可能几乎没有或完全没有效果。
2. Java 事件连接器(基于等级的缩放)
该附加组件监听 MT Inventory Weight 的最大负重事件:
InventoryWeightEvents.MODIFY_MAX_WEIGHT
并根据技能类别的经验等级缩放容量,通过 Pufferfish 的 SkillsAPI(Category.getExperience().getLevel(player))读取。参见下方的配置。
如果一个节点授予了属性(路径 1),并且你按等级缩放相同的值(路径 2),这些加成会叠加。
内置“携带”技能树
该模组捆绑了一个可选的 Pufferfish 类别 carrying:
- 作为 Fabric 内置数据包注册在 jar 包的
resourcepacks/carrying/ 中,因此它会出现在世界创建的数据包屏幕中,默认情况下是禁用的。
- 节点授予
inventoryweight:generic.max_weight(固定值和百分比),并带有一个小的移动速度节点和最终节点。
- 通过挖掘方块和合成物品获得经验。
- 强大的百分比/机动性节点位于树的更深处,被几个固定值节点锁定。
启用它:
- 新世界 → 创建世界 → 数据包 → 将“携带技能树”移动到活动侧,或者
- 现有世界 →
/datapack list,然后 /datapack enable "<id>"。
打开技能屏幕(默认按键 K)以查看携带类别。
默认包 vs. 你自己的包(整合包开发者 / 服务器管理员)
你不必局限于捆绑的树:
- 使用默认值 — 启用内置的“携带技能树”包。不需要文件。
- 覆盖它 — 发送一个重新定义
puffish_skills 命名空间下 carrying 类别的数据包。加载较晚的包会覆盖内置文件(每个文件的最后一个包获胜)。保持内置包禁用以避免混合。
- 添加单独的树 — 用不同的 ID(和你的命名空间)定义一个新类别,并关闭内置的
carrying。对于整合包来说是最干净的:没有冲突。
无论哪个包的 config.json 胜出,都必须列出你想要加载的所有类别。
配置(Java 事件路径)
通过 fzzy_config 同步的服务端配置:
config/pufferfishs-skills-inventoryweight/server-config.*
常规
| 选项 |
默认值 |
描述 |
enabled |
true |
主开关。 |
minimumMaxWeight |
1.0 |
最终最大负重的下限。 |
category(默认开启)
根据一个配置的类别的经验等级进行缩放。
| 选项 |
默认值 |
描述 |
category.enabled |
true |
启用基于类别的缩放。 |
category.categoryId |
puffish_skills:adventure |
要读取的类别 ID。如果省略,命名空间默认为 puffish_skills。 |
category.additivePerLevel |
0.0 |
每类别等级的固定奖励。 |
category.multiplierPerLevel |
0.05 |
0.05 = 每等级 +5%。 |
totalLevel(默认关闭)
根据所有类别的经验等级总和进行缩放。
| 选项 |
默认值 |
描述 |
totalLevel.enabled |
false |
启用组合等级缩放。 |
totalLevel.additivePerLevel |
0.0 |
每组合等级的固定奖励。 |
totalLevel.multiplierPerLevel |
0.0 |
0.01 = 每组合等级 +1%。 |
公式
result = (currentMaxWeight + additive) * multiplier
result = max(minimumMaxWeight, result)
currentMaxWeight 是 MT Inventory Weight 已经计算出的值,因此这与基础配置、盔甲口袋和其他 Inventory Weight 附加组件叠加。
示例
基础最大负重: 100
类别等级 (冒险): 10
category.multiplierPerLevel: 0.05
multiplier = 1 + 10 * 0.05 = 1.5
result = (100 + 0) * 1.5 = 150
注意事项
- 如果类别不存在或没有经验来源,则贡献为
0。
- 负的配置值会被钳制为中性。
- 在你的 Pufferfish's Skills 数据包/配置中找到类别 ID(即
puffish_skills:<id>)。
- 内置树是
NORMAL(默认关闭);在数据包屏幕中启用它。
故障排除
- 技能不赋予重量 — 确认属性 ID 精确为
inventoryweight:generic.max_weight,优先使用 operation: addition(加法),并在编辑奖励后重置该技能,以便重新应用修正值。
- 内置树缺失 — 默认情况下它已被禁用;请启用它。检查日志中是否显示
Registered built-in 'carrying' datapack: true。
pack.mcmeta 无法加载 — 描述字段必须是严格的 JSON 格式(不得使用智能引号 / 尾随逗号)。
experience.json 中的 Unknown variable 'true' — 条件必须引用已定义的变量;若需无条件获得经验值,请使用裸字符串如 "experience": "1"。
文档
完整文档:请参阅 docs/pufferfishs-skills.md(或在线文档站点)。
Pufferfish's Skills InventoryWeight
Pufferfish's Skills InventoryWeight is a server-side add-on that connects
MT Inventory Weight with Pufferfish's Skills.
It lets a player's skill progression increase their maximum inventory weight capacity, in
two ways:
- Attribute reward (data-driven) — a skill node grants the Inventory Weight attribute
directly. No Java needed; this is how the bundled "Carrying" tree works.
- Java event connector — the add-on reads a skill category's experience level and
modifies max weight through MT Inventory Weight's event.
It also ships an optional, built-in "Carrying" skill tree you can enable per world.
This mod is not standalone.
MT Inventory Weight registers a vanilla-style attribute:
inventoryweight:generic.max_weight
Pufferfish's Skills can grant any registered attribute via its puffish_skills:attribute
reward, so a skill node can grant max weight directly.
1. Attribute reward (data-driven, no Java)
In a category's definitions.json, a skill definition lists rewards. Point a
puffish_skills:attribute reward at inventoryweight:generic.max_weight:
{
"type": "puffish_skills:attribute",
"data": {
"attribute": "inventoryweight:generic.max_weight",
"value": 200.0,
"operation": "addition"
}
}
operation |
Effect |
addition / add / add_value |
Flat add (e.g. +200). Recommended. |
multiply_base / add_multiplied_base |
Add a fraction of the attribute base. |
multiply_total / add_multiplied_total |
Multiply the running total. |
Prefer addition. If the attribute base is 0, multiply_* operations may have little or
no effect.
2. Java event connector (level-based scaling)
The add-on listens to MT Inventory Weight's max-weight event:
InventoryWeightEvents.MODIFY_MAX_WEIGHT
and scales capacity by a skill category's experience level, read via Pufferfish's
SkillsAPI (Category.getExperience().getLevel(player)). See the config below.
If a node grants the attribute (path 1) AND you scale the same value by level (path 2),
the bonuses stack.
Built-in "Carrying" skill tree
The mod bundles an optional Pufferfish category, carrying:
- Registered as a Fabric built-in datapack at
resourcepacks/carrying/ in the jar, so it
shows up in the world-creation Data Packs screen, disabled by default.
- Nodes grant
inventoryweight:generic.max_weight (flat and percent), with a small
movement-speed node and a capstone.
- Earns experience from mining blocks and crafting items.
- The strong percent/mobility nodes are placed deeper in the tree, gated behind several
flat nodes.
Enable it:
- New world → Create World → Data Packs → move "Carrying Skill Tree" to the active
side, or
- Existing world →
/datapack list, then /datapack enable "<id>".
Open the skills screen (default key K) to see the Carrying category.
Default pack vs. your own pack (modpack devs / server admins)
You are not locked into the bundled tree:
- Use the default — enable the built-in "Carrying Skill Tree" pack. No files needed.
- Override it — ship a datapack that redefines the
carrying category under the
puffish_skills namespace. A later-loaded pack overrides the built-in files
(last pack wins per file). Keep the built-in pack disabled to avoid mixing.
- Add a separate tree — define a NEW category with a different id (and your own
namespace) and leave the built-in
carrying off. Cleanest for modpacks: no conflicts.
Whichever pack's config.json wins must list every category you want loaded.
Configuration (Java event path)
Synced server config via fzzy_config:
config/pufferfishs-skills-inventoryweight/server-config.*
General
| Option |
Default |
Description |
enabled |
true |
Master switch. |
minimumMaxWeight |
1.0 |
Floor for the final max weight. |
category (default on)
Scales by one configured category's experience level.
| Option |
Default |
Description |
category.enabled |
true |
Enable category-based scaling. |
category.categoryId |
puffish_skills:adventure |
Category id to read. Namespace defaults to puffish_skills if omitted. |
category.additivePerLevel |
0.0 |
Flat bonus per category level. |
category.multiplierPerLevel |
0.05 |
0.05 = +5% per level. |
totalLevel (default off)
Scales by the sum of all categories' experience levels.
| Option |
Default |
Description |
totalLevel.enabled |
false |
Enable combined-level scaling. |
totalLevel.additivePerLevel |
0.0 |
Flat bonus per combined level. |
totalLevel.multiplierPerLevel |
0.0 |
0.01 = +1% per combined level. |
Formula
result = (currentMaxWeight + additive) * multiplier
result = max(minimumMaxWeight, result)
currentMaxWeight is the value MT Inventory Weight already computed, so this stacks with the
base config, armor pockets, and other Inventory Weight add-ons.
Example
Base max weight: 100
category level (adventure): 10
category.multiplierPerLevel: 0.05
multiplier = 1 + 10 * 0.05 = 1.5
result = (100 + 0) * 1.5 = 150
Notes
- A category contributes
0 if it doesn't exist or has no experience source.
- Negative config values are clamped to neutral.
- Find category ids in your Pufferfish's Skills datapack/config (the
puffish_skills:<id>).
- The built-in tree is
NORMAL (off by default); enable it in the Data Packs screen.
Troubleshooting
- A skill grants no weight — confirm the attribute id is exactly
inventoryweight:generic.max_weight, prefer operation: addition, and reset the skill
after editing a reward so the modifier reapplies.
- Built-in tree missing — it's disabled by default; enable it. Check the log for
Registered built-in 'carrying' datapack: true.
pack.mcmeta won't load — the description must be strict JSON (no smart quotes /
trailing commas).
Unknown variable 'true' in experience.json — conditions must reference a defined
variable; for unconditional XP use a bare string like "experience": "1".
Documentation
Full documentation: see docs/pufferfishs-skills.md (or the online docs site).
评论 0
登录后参与评分
还没有评论,来抢沙发吧