CombatTracker

Tracks recent combat timestamps for players to gate NPC interactions.

When a player takes or deals PvP damage, their UUID is recorded with the current time. NPC GUIs check isInCombat before opening to prevent abuse during fights.

Functions

Link copied to clipboard
fun isInCombat(playerUuid: UUID, cooldownMs: Long = DEFAULT_COOLDOWN_MS): Boolean

Returns true if the player was in combat within the cooldown window.

Link copied to clipboard
fun recordCombat(playerUuid: UUID)

Records that a player was just involved in combat.