属性上限解除 / Attribute Cap Lift

让属性上限不再影响「数值转加成」,属性本身仍然受限/ Lets curios convert attribute values into bonuses without being blocked by attribute caps, while the attribute's actual effect on the player stays capped.

属性上限解除 / Attribute Cap Lift

让属性上限不再影响「数值转加成」,属性本身仍然受限。

## English Summary 

> Lets curios convert attribute values into bonuses without being blocked by attribute caps, while the attribute's actual effect on the player stays capped.

---

## English Description

### The problem

Many modpacks use **AttributeFix** and similar mods to cap attributes (for example, clamping movement speed to `0.5`).

Some curios work by **reading an attribute value and converting it into a bonus**:

- Gallop Necklace: `movement speed × 1.5` becomes extra damage
- Light Speed Propeller: damage amplifier derived from movement speed

When the attribute is capped, **the conversion gets capped too** — you stack movement speed, but the curio only sees the capped value.

**This mod separates the two:**

| Who reads the value | What they get |
|---|---|
| **A curio's conversion logic** | **The real, uncapped value** |
| **The attribute's actual effect on the player** | **Still capped** |

### Example

```
Player's actual movement speed = 0.5   (still capped)
Gallop Necklace bonus = 2.23 × 1.5     (uses the uncapped value)
```

### How it works

1. Intercepts `AttributeInstance#getValue()` and returns the value
   **before `sanitizeValue`** — only the final clamp is removed; the
   addition/multiplication chain is bit-identical to vanilla.
2. Re-applies `getMaxValue()` at the three places where speed is actually
   consumed by movement:
   - `getFrictionInfluencedSpeed` (ground movement)
   - `travel` (swimming branch)
   - `getFlyingSpeed` (passenger flight)

So: **every mod reading the attribute gets the real value, but the player
does not actually move faster.**

### Configuration

```toml
[general]
    enabled = true
    watchedAttributes = ["minecraft:generic.movement_speed"]
    clampInTravel = true
    debugLog = false
```

- `watchedAttributes` — which attributes return uncapped values (movement speed by default)
- `clampInTravel` — re-apply the cap on the movement path (disable and the player really will speed up)
- `debugLog` — log every clamp event with the actual numbers

### Notes

- **Only movement speed has a clamp point.** Adding other attributes to
  `watchedAttributes` will *genuinely* uncap them.
- Knockback strength scales with movement speed (it reads the same attribute).
- **Must be installed on both client and server.**
- No other mod is required; works fine without AttributeFix.

### Use cases

- Your pack caps movement speed via AttributeFix, which breaks speed-based curios
- You want "attribute → bonus" curios to see the real values you stacked
- Without letting the player actually run that fast

## 中文简介

> 让饰品把属性数值换算成加成时不再被属性上限卡住,而属性对玩家的实际效果仍然照常受限。

---

## 中文详细说明

### 这个模组解决什么问题

很多整合包会用 **AttributeFix** 之类的模组给属性设置上限(例如把移动速度压到 `0.5`)。

但有些饰品的加成逻辑是「**读取属性值 → 换算成伤害加成**」:

- 疾行项链:`移动速度 × 1.5` 变成附加伤害
- 光速螺旋桨:按移动速度换算伤害增幅

当属性被上限卡住时,**这些换算也被一起卡住了** —— 你堆了很高的移速,饰品却只按上限值算。

**本模组把这两件事拆开:**

| 谁在读 | 读到什么 |
|---|---|
| **饰品的换算逻辑** | **未受限的真实值** |
| **属性对玩家的实际作用** | **仍然被上限限制** |

### 效果示例

```
玩家实际移动速度 = 0.5      (仍受上限限制)
疾行项链的附加伤害 = 2.23 × 1.5  (按未受限值计算)
```

### 工作原理

1. 拦截 `AttributeInstance#getValue()`,返回**未经 `sanitizeValue` 处理的值**
   —— 只去掉原版计算最后那一步的 clamp,前面的加法/乘法逐位保持一致
2. 在移动的三个消费点把值**压回 `getMaxValue()`**:
   - `getFrictionInfluencedSpeed`(地面移动)
   - `travel`(游泳分支)
   - `getFlyingSpeed`(乘客飞行)

因此:**任何模组读属性都能拿到真实值,但玩家不会真的跑得飞快。**

### 配置

```toml
[general]
    enabled = true
    watchedAttributes = ["minecraft:generic.movement_speed"]
    clampInTravel = true
    debugLog = false
```

- `watchedAttributes` —— 哪些属性返回未受限值(默认只有移动速度)
- `clampInTravel` —— 是否在移动路径压回上限(关闭后玩家会真的变快)
- `debugLog` —— 打印每次回落的具体数值

### 注意事项

- **只有移动速度有回落点**。把其他属性加进 `watchedAttributes` 会**真的解除限制**
- 击退强度会随移速变化(它读的是同一个属性)
- 客户端与服务端**都需要安装**
- 不依赖任何其他模组;没装 AttributeFix 也能正常使用

### 适用场景

- 整合包用 AttributeFix 压低了移速上限,导致移速类饰品失效
- 想让「属性数值转加成」的饰品正常吃到你堆的属性
- 又不想因此让角色跑得失去平衡

---

## 兼容性 / Compatibility

- Minecraft 1.20.1
- Forge 47.x
- 客户端与服务端都需安装 / Required on both client and server
- MIT License

属性上限解除 / Attribute Cap Lift Team

profile avatar
  • 3
    Projects
  • 384
    Downloads

More from qianzhiqinghang

  • 伤害探针 / Damage Probe project image

    伤害探针 / Damage Probe

    Test-only tool: splits one damage instance from "intent" to "actual health lost" and shows which mod changed it and where it was swallowed. **Do not install for normal gameplay.**

    • 8
    • November 19, 2026
  • 神秘遗物增强 (Enigmatic Enhance) project image

    神秘遗物增强 (Enigmatic Enhance)

    Enigmatic Enhance is an add-on mod for Enigmatic Legacy. It enhances the curios found in Enigmatic Legacy and its add-on mod, and also includes some content built around its own mechanics.

    • 366
    • November 14, 2026
  • 伤害探针 / Damage Probe project image

    伤害探针 / Damage Probe

    Test-only tool: splits one damage instance from "intent" to "actual health lost" and shows which mod changed it and where it was swallowed. **Do not install for normal gameplay.**

    • 8
    • November 19, 2026
  • 神秘遗物增强 (Enigmatic Enhance) project image

    神秘遗物增强 (Enigmatic Enhance)

    Enigmatic Enhance is an add-on mod for Enigmatic Legacy. It enhances the curios found in Enigmatic Legacy and its add-on mod, and also includes some content built around its own mechanics.

    • 366
    • November 14, 2026