Combat State
作者:rebot | 分类:模组
Minecraft 版本: 1.21.1
平台: neoforge
标签: library utility
Combat State
Track when a player is still in combat, even after a mob switches targets.
Combat State is a small shared dependency for combat-aware Minecraft mods and modpacks. It gives other mods a clear server-side answer to: “is this player still in combat?”
Combat rules
A player enters combat with a mob when that mob targets the player.
The player stays in combat with that mob if the mob switches target during the fight. Target switching alone does not end combat.
The player leaves combat with that mob when either:
- the mob has no target anymore, or
- the mob is not currently targeting that player and the player is more than 64 blocks away.
What it provides
- Server-side combat tracking for players.
- A small API for dependent mods.
- Configurable disengage distance.
- Optional yellow indicator for mobs that still keep you in combat but are not currently targeting you.
- Aggro Indicator compatibility: Aggro Indicator can keep showing the red current-target icon, while Combat State adds the yellow combat-memory icon.
API
Use CombatStateApi on the server:
CombatStateApi.isInCombat(player);
CombatStateApi.isActivelyTargeted(player);
CombatStateApi.getCombatMobIds(player);
Configuration
Config file:
config/combat_state-common.toml
Default values:
[combat]
disengageDistance = 64
syncIntervalTicks = 20
[client]
renderYellowIndicator = true
Requirements
- Minecraft 1.21.1
- NeoForge
Optional integration:
- Aggro Indicator
Source and issues
请登录后举报
暂无评论,抢个沙发吧~