
Data Attributes
适用于 Fabric 和 NeoForge 上 Minecraft 1.21.1 的数据驱动实体属性框架。
Data Attributes 让 Minecraft 的属性系统变得更加易于定制,无需将每个更改都硬编码到其他模组中。服务器管理员和整合包制作者可以修改属性的上下限以及叠加行为,从一个属性派生出另一个属性,并为单个实体类型或更广泛的实体组分配基础值。
它本身并不添加进度系统或一系列新内容。你可以将其视为数据包的、服务器和其他模组可以构建其上的属性层。
本项目由 CleverNucleus 的原始 Data Attributes 延续而来,并由 Bare Minimum Studios 维护。它在 Modrinth 上列为 Data Attributes,在 CurseForge 上列为 Data Attributes: DC。
三个独立的层级
属性定义覆盖 (Attribute Definition Overrides)
定义覆盖会更改属性的规则:允许的最低/最高值、叠加公式、递减平滑度和显示格式。
它们不设置实体值。 如果你将 minecraft:generic.max_health 的最大值提高到 2048,你只是将上限提高到了 2048;并没有给每个实体 2048 点生命值。
属性函数 (Attribute Functions)
函数将一个父级/源属性连接到一个子级/派生属性。父级的当前值可以使用可配置的系数来增加或乘以子级,从而使得后续统计成为可能,而无需将这些统计烘焙到每个模组中。
实体基础属性 (Entity Base Attributes)
实体条目是实际分配原始基础值的地方。你可以针对具体的实体(如 minecraft:player),也可以使用 Data Attributes 提供的更广泛的实体组,然后在上面叠加特定的条目。
例如,minecraft:player -> minecraft:generic.max_health = 2 会给玩家赋予 2 点最大生命值的基础值。
数据包 + 服务器配置
Data Attributes 按照以下顺序解析其设置:
原版默认值 → 数据包 → 服务器配置
服务器配置使用 Fzzy Config 并包含一个“数据包基线预览”(Datapack Baseline Preview),因此管理员可以在覆盖之前查看数据包提供了什么内容。
数据包使用以下路径:
data/<namespace>/data_attributes/overrides/*.json
data/<namespace>/data_attributes/functions/*.json
data/<namespace>/data_attributes/entity_types/*.json
实时编辑
通过游戏内 Fzzy Config 界面接受的更改会立即生效。已加载的现有生物实体将在下一次刻时采用供应商拥有的基础更改。
数据包的 JSON 更改使用原版的 /reload。手动更改磁盘上 Fzzy 的 JSON5 文件是单独的;/reload 仅重新加载数据包/资源,并且不会重新读取任意的 Fzzy 配置文件。
要求
Fabric 1.21.1
- Fabric API
- Fabric Language Kotlin
- Fzzy Config
NeoForge 1.21.1
- Kotlin for Forge (NeoForge)
- Fzzy Config
OWO Lib/OOLib、OWO Sentinel 和 Endec 不是当前源码所必需的依赖项。
兼容性说明: Data Attributes 不建议与 AttributeFix 一起使用。两者都会修改相同的属性边界/能力层,可能会发生冲突。
链接
赞助
使用代码 bareminimum 可获得 首月 25% 折扣!
许可证
当前的 Bare Minimum Studios 版本使用 Bare Minimum License (BML) v1.0。请参阅 许可证 以获取完整条款。

Data Attributes
A data-driven entity attribute framework for Minecraft 1.21.1 on Fabric and NeoForge.
Data Attributes makes Minecraft's attribute system much easier to shape without hard-coding every change into another mod. Server owners and pack makers can change attribute bounds and stacking behavior, derive one attribute from another, and assign base values to individual entity types or broader entity groups.
It does not add a progression system or a collection of new content by itself. Think of it as the attribute layer that datapacks, servers, and other mods can build on.
This project continues the original Data Attributes by CleverNucleus and is maintained by Bare Minimum Studios. It is listed as Data Attributes on Modrinth and Data Attributes: DC on CurseForge.
Three separate layers
Attribute Definition Overrides
Definition overrides change the rules of an attribute: its allowed minimum/maximum, stacking formula, diminishing smoothness, and display format.
They do not set entity values. If you raise minecraft:generic.max_health's maximum to 2048, you have raised the ceiling to 2048; you have not given every entity 2048 health.
Attribute Functions
Functions connect a parent/source attribute to a child/derived attribute. The parent's current value can add to or multiply the child using a configurable coefficient, which makes follow-on stats possible without baking them into every mod.
Entity Base Attributes
Entity entries are what actually assign raw base values. You can target a concrete entity such as minecraft:player, or use Data Attributes' broader entity groups and then layer specific entries on top.
For example, minecraft:player -> minecraft:generic.max_health = 2 gives players a max-health base of 2.
Datapacks + server config
Data Attributes resolves its settings in this order:
Vanilla defaults → datapacks → server configuration
The server configuration uses Fzzy Config and includes a Datapack Baseline Preview, so administrators can see what datapacks are supplying before they override it.
Datapacks use these paths:
data/<namespace>/data_attributes/overrides/*.json
data/<namespace>/data_attributes/functions/*.json
data/<namespace>/data_attributes/entity_types/*.json
Live editing
Changes accepted through the in-game Fzzy Config screen apply live. Existing loaded living entities adopt supplier-owned base changes on their next tick.
Datapack JSON changes use vanilla /reload. Manually changing Fzzy's JSON5 file on disk is separate; /reload only reloads datapack/resources and does not reread arbitrary Fzzy config files.
Requirements
Fabric 1.21.1
- Fabric API
- Fabric Language Kotlin
- Fzzy Config
NeoForge 1.21.1
- Kotlin for Forge (NeoForge)
- Fzzy Config
OWO Lib/OOLib, OWO Sentinel, and Endec are not required by the current source.
Compatibility note: Data Attributes is not intended to be used with AttributeFix. Both modify the same attribute bounds/capabilities layer and can conflict.
Links
Sponsor
Use code bareminimum to get 25% off your first month!
License
Current Bare Minimum Studios releases use the Bare Minimum License (BML) v1.0. See the license for the full terms.
评论 0
登录后参与评分
还没有评论,来抢沙发吧