HomeJavaModsCombat State
Combat State

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:

What it provides

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

Optional integration:

Source and issues

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more