
两个模组,一套火系法术强度。 法术强度(Spell Power)以点数计算火系伤害,而 Iron's Spells 则以百分比计算,且来自不同模组的装备只会提升其各自对应的数值。Attributification 将一个模组的属性映射到另一个模组的对应属性上:物品加成会按正确的比例转移到目标属性,而被替换的源属性则会显示转换后的值,从而确保读取该属性的工具提示和公式仍能正常工作。
在 Fabric 加载器下,还需安装 Fabric API。
在服务端和每个客户端上都安装它(在单人游戏中,你的游戏既是服务端也是客户端)。没有安装该模组的玩家仍然可以加入服务器,但他们看到的工具提示和背包中的数值未经转换,且无法打开编辑器。

- 映射关系由数据包文件定义, 因此你可以将其随整合包一起分发,针对不同世界进行更改,并通过
/reload 命令应用。
- 加成按比例转移。 法术强度的 +6 火系伤害会变成 +30% 火系法术强度;固定加成也可以转换为百分比。
- 另一模组的工具提示和公式继续正常工作。
- 对生物同样有效: 拥有源属性但不具备目标属性的实体将获得目标属性(在所有模式除
onlyVisualChange 外),使其加成仍能被转换;目标属性会被保存到实体中。
- 回退机制: 可列出多个目标,使用第一个已安装的模组提供的属性。
- 通配符支持:
spell_power:* 会映射某模组的所有属性,exclude 可排除某些特定属性。
- 无双重加成: 在
fullReplacement 模式下,源属性保持其基础值不变,因此只有目标属性的模组会使用加成。
- 客户端数值一致: 服务端会在玩家加入及每次重载后向其发送映射配置。
- 游戏内编辑器: 供操作员(权限等级 2)使用:
/attributification gui。保存的更改立即生效。
- 预置映射配置: 适用于 Spell Power、Iron's Spells、Apothic Attributes、Obscure API、Turtleboi's Core Library、GTBC 的 SpellLib 和 Geomancy Plus、Ars Nouveau、Eidolon、Goety、Lodestone、Wizard's Reborn、Ranged Weapon API、More RPG Classes、Iter RPG 以及 T.O Magic 'n Extras。如果你没有安装某个模组,针对它的映射配置将不会执行任何操作。

将其安装在与存在属性重叠的模组旁边。内置映射配置无需设置:带有法术强度火系加成的戒指现在会提升 Iron's Spells 的火系法术强度。
要添加映射配置,请打开 /attributification gui 并在其中创建文件(它保存在世界中,位于 <world>/datapacks/attributification_gui/),或者将文件放入任意数据包的 data/<namespace>/attributification/mappings/ 目录下并运行 /reload。例如,data/mypack/attributification/mappings/earth.json:
{
"mappings": [
{
"source": "spell_power:earth",
"targets": ["gtbcs_geomancy_plus:geo_spell_power", "irons_spellbooks:nature_spell_power"],
"equivalence": 3.0,
"conversionEquivalence": 20.0,
"operationConversion": "ADDITION_TO_MULTIPLY_BASE"
}
]
}
具有 +6 法术强度土系加成的靴子现在提供 +30% 地系法术强度(6 / 20 = 0.3,作为基础值的份额添加),或者在地系法术强度模组未安装时提供自然法术强度。法术强度的土系属性显示为地系法术强度 × 3。

| 字段 |
省略时的默认值 |
作用 |
source / sources |
- |
要替换的属性,单个 ID 或列表;* 匹配 ID 的任何部分 |
target / targets |
- |
加成转移的目标位置,单个 ID 或列表:使用第一个已安装的模组;此处的 * 会填充源属性 * 所匹配的内容(例如从 spell_power:* 到 mymod:*_power) |
exclude |
无 |
通配符源属性跳过的 ID(允许使用 *) |
mode |
bidirectional |
bidirectional:加成转移到目标,源属性读数为 目标值 × equivalence;unidirectional:加成转移到目标,源属性读数为 目标值,无缩放;onlyVisualChange:仅工具提示中的名称发生变化,加成保留在源属性上;fullReplacement:加成转移到目标,源属性保持其基础值 |
equivalence |
1 |
源属性读数为 目标值 × 此系数;不允许为 0 |
conversionEquivalence |
0(使用 equivalence) |
到达源属性的加成(来自物品、效果或其他模组)在向目标转移时会除以该值 |
subtractValue |
0 |
在应用 equivalence 之前从目标值中减去,用于处理基础值不同的属性 |
operationConversion |
DEFAULT |
DEFAULT 保持加成原样;ADDITION_TO_MULTIPLY_BASE 或 ADDITION_TO_MULTIPLY_TOTAL 将固定加成转换为基于基础值或总值的百分比 |
comment |
无 |
给人看的注释;模组会忽略它 |
内置映射配置位于模组内的 data/attributification/attributification/mappings/defaults.json:一个路径相同的文件的数据包可以覆盖它们,其中的 {"mappings": []} 可禁用这些内置映射。
编辑器(/attributification gui,仅限操作员)列出所有映射文件。世界数据包中的文件可以编辑和删除(子文件夹中的文件除外);来自其他数据包和模组本身的文件为只读。覆盖操作会将可编辑的副本保存到世界中;该副本将替换原始文件。保存立即生效;如果编辑器提示运行 /reload,请执行此命令。大于 1 MB 的文件无法在编辑器中打开。保存可能在几百 KB 时就失败:此时编辑器会提示文件过大。请将此类文件拆分或手动编辑。模组本身最多支持加载 8 MB 的文件。
**如果某个映射未生效,**请查看服务器日志。每处错误都会报告对应的文件和映射内容:例如属性 ID 拼写错误、未知字段或模式、equivalence 为 0、除以零等。此类映射将被跳过。一行摘要信息会显示有多少映射处于激活状态,以及有多少映射因依赖未安装的模组而等待加载。如果命令 /attributification gui 不被识别,说明你并非操作员(权限等级 2)。如果该命令未能打开编辑器,请在你的客户端安装与服务器相同版本的模组。
日志级别(默认为 NONE、ERRORS、WARNINGS,可选 ALL)位于 Fabric 的 config/attributification.json 中的 debug.logLevel,Forge 和 NeoForge(最高至 26.2 版本)的 config/attributification-common.toml,以及 NeoForge 26.3 的 config/attributification-local.toml。数据包可以通过在 data/<namespace>/attributification/config.json 中设置 {"logLevel": "ALL"} 来更改此级别。
从 2.0 版本升级? Fzzy Config 已不再需要。打开 /attributification gui:它会查找旧配置文件(config/attributification/attributification.toml)中的映射,并在你点击“转换旧配置”时将其转换为世界的数据包。随后,旧文件会被添加 .converted 后缀(变为 attributification.toml.converted),以便其他世界不会看到它。若要在其他世界获得相同的映射,请将已转换世界中的 datapacks/attributification_gui 复制到其他世界的文件夹中。对于值为 0 的 2.0 版 equivalence 映射,若修改安全则就地修复;否则将跳过并附带警告。
相同理念,用于效果: Effectification。

想要和朋友一起拥有自己的服务器吗?通过我的链接使用 BisectHosting,首单可享 25% 折扣,我将获得少量佣金。


MIT 许可证:可免费使用、修改、分享并包含在整合包中,前提是保留版权声明。详见 LICENSE。
本作品非官方 Minecraft 产品。未经 Mojang 或 Microsoft 批准或认可。


Two mods, one Fire Spell Power. Spell Power counts fire power in points, Iron's Spells in percent, and gear from each mod raises only its own number. Attributification maps an attribute of one mod onto the matching attribute of another: item bonuses move to the target attribute at the right scale, and the source attribute (the one being replaced) reports the converted value, so tooltips and formulas that read it keep working.
On Fabric, also install Fabric API.
Install it on the server and on every client (in single player, your game is both). A player without the mod can still join a server, but sees unconverted numbers in tooltips and the inventory and cannot open the editor.

- Mappings are data-pack files, so you can ship them with a modpack, change them per world and apply them with
/reload.
- Bonuses move at the right scale. Spell Power's +6 Fire becomes +30% Fire Spell Power; a flat bonus can turn into a percentage.
- Tooltips and formulas of the other mod keep working.
- Works on mobs too: an entity that has the source attribute but not the target gets the target (in every mode but
onlyVisualChange), so its bonuses still convert; the target is saved with the entity.
- Fallbacks: list several targets, and the first one that is installed is used.
- Wildcards:
spell_power:* maps every attribute of a mod, exclude leaves some out.
- No double bonuses: in
fullReplacement mode the source attribute stays at its base value, so only the target's mod uses the bonus.
- Same numbers on the client: the server sends its mappings to every player on join and after each reload.
- An editor in the game for operators (permission level 2):
/attributification gui. Saved changes apply at once.
- Ready-made mappings for Spell Power, Iron's Spells, Apothic Attributes, Obscure API, Turtleboi's Core Library, GTBC's SpellLib and Geomancy Plus, Ars Nouveau, Eidolon, Goety, Lodestone, Wizard's Reborn, Ranged Weapon API, More RPG Classes, Iter RPG and T.O Magic 'n Extras. A mapping for a mod you don't have does nothing.

Install it next to the mods whose attributes overlap. The built-in mappings need no setup: a ring with Spell Power's Fire now raises Iron's Spells' Fire Spell Power.
To add a mapping, open /attributification gui and create a file there (it is saved in the world, in <world>/datapacks/attributification_gui/), or put a file into any data pack under data/<namespace>/attributification/mappings/ and run /reload. For example, data/mypack/attributification/mappings/earth.json:
{
"mappings": [
{
"source": "spell_power:earth",
"targets": ["gtbcs_geomancy_plus:geo_spell_power", "irons_spellbooks:nature_spell_power"],
"equivalence": 3.0,
"conversionEquivalence": 20.0,
"operationConversion": "ADDITION_TO_MULTIPLY_BASE"
}
]
}
Boots with +6 Spell Power Earth now give +30% Geo Spell Power (6 / 20 = 0.3, added as a share of the base value), or Nature Spell Power when Geomancy Plus is not installed. Spell Power's Earth reads as Geo Spell Power × 3.

| Field |
If left out |
What it does |
source / sources |
- |
the attribute to replace, one ID or a list; * matches any part of the ID |
target / targets |
- |
where the bonuses go, one ID or a list: the first installed one is used; a * here is filled with what the source's * matched (spell_power:* to mymod:*_power) |
exclude |
none |
IDs (* allowed) that a wildcard source skips |
mode |
bidirectional |
bidirectional: bonuses go to the target, the source reads as the target × equivalence; unidirectional: bonuses go to the target, the source reads as the target, unscaled; onlyVisualChange: only the name in tooltips changes, bonuses stay on the source; fullReplacement: bonuses go to the target, the source keeps its base value |
equivalence |
1 |
the source reads as the target's value times this; 0 is not allowed |
conversionEquivalence |
0 (use equivalence) |
bonuses that reach the source (from items, effects, other mods) are divided by it on their way to the target |
subtractValue |
0 |
taken off the target's value before equivalence, for attributes with different base values |
operationConversion |
DEFAULT |
DEFAULT keeps the bonus as it is; ADDITION_TO_MULTIPLY_BASE or ADDITION_TO_MULTIPLY_TOTAL turn a flat bonus into a percentage of the base or the total value |
comment |
none |
a note for people; the mod ignores it |
The built-in mappings are data/attributification/attributification/mappings/defaults.json in the mod: a data pack with a file of the same path replaces them, and {"mappings": []} in it turns them off.
The editor (/attributification gui, operators only) lists every mapping file. Files in the world's data pack can be edited and deleted (except files in subfolders); files from other data packs and from the mod are read-only. Override saves an editable copy into the world; the copy replaces the original. A save applies at once; if the editor asks for /reload, run it. Files larger than 1 MB cannot be opened in the editor. Saving can fail earlier, at a few hundred KB: the editor then says the file is too large. Split such files or edit them by hand. The mod itself loads files up to 8 MB.
If a mapping does nothing, look in the server log. Every mistake is reported with the file and the mapping: a typo in an attribute ID, an unknown field or mode, equivalence 0, a division by zero. Such a mapping is skipped. One summary line tells how many mappings are active and how many wait for mods that are not installed. If the command /attributification gui is unknown, you are not an operator (level 2). If it does not open the editor, install the mod on your client, in the same version as on the server.
The log level (NONE, ERRORS, WARNINGS by default, ALL) is debug.logLevel in config/attributification.json on Fabric, config/attributification-common.toml on Forge and NeoForge up to 26.2, and config/attributification-local.toml on NeoForge 26.3. A data pack can set it with {"logLevel": "ALL"} in data/<namespace>/attributification/config.json.
Coming from 2.0? Fzzy Config is no longer needed. Open /attributification gui: it finds the mappings of the old config file (config/attributification/attributification.toml) and converts them into the world's data pack when you press Convert Old. The old file then gets a .converted suffix (attributification.toml.converted), so other worlds won't see it. To get the same mappings there, copy datapacks/attributification_gui from the converted world into the other world's folder. A 2.0 mapping with equivalence 0 is fixed where it is safe; otherwise it is skipped with a warning.
Same idea, for effects: Effectification.

Want your own server to play on with friends? BisectHosting gives you 25% off your first purchase through my link, and I get a small commission.


MIT License: free to use, modify, share and include in modpacks, as long as the copyright notice stays with it. See LICENSE.
Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.

评论 0
登录后参与评分
还没有评论,来抢沙发吧