Contents
Class DamageMemory
java.lang.Object
com.hypixel.hytale.builtin.npccombatactionevaluator.memory.DamageMemory
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
Stores damage taken by an NPC for use by the
CombatActionEvaluator and related conditions, split by
DamageSourceType and damage cause index.
Recent damage is cleared each time the combat action evaluator executes. Total damage is cleared when the NPC is not in combat.
-
Field Summary
Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDamage(DamageSourceType source, int damageCauseIndex, float damage) voidvoidclone()static ComponentType<EntityStore, DamageMemory> floatgetRecentDamage(DamageSourceType source, IntPredicate damageCauseFilter) floatgetTotalDamage(DamageSourceType source, IntPredicate damageCauseFilter) toString()Methods inherited from interface Component
cloneSerializable
-
Constructor Details
-
DamageMemory
public DamageMemory()
-
-
Method Details
-
getComponentType
-
getRecentDamage
public float getRecentDamage(@Nonnull DamageSourceType source, @Nonnull IntPredicate damageCauseFilter) -
getTotalDamage
public float getTotalDamage(@Nonnull DamageSourceType source, @Nonnull IntPredicate damageCauseFilter) -
addDamage
-
clearRecentDamage
public void clearRecentDamage() -
clearTotalDamage
public void clearTotalDamage() -
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-
toString
-