Class DamageDataComponent

java.lang.Object
com.hypixel.hytale.server.core.entity.damage.DamageDataComponent
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class DamageDataComponent extends Object implements Component<EntityStore>
A component that holds the damage-related data for an entity.
  • Constructor Details

    • DamageDataComponent

      public DamageDataComponent()
  • Method Details

    • getComponentType

      @Nonnull public static ComponentType<EntityStore, DamageDataComponent> getComponentType()
      Returns:
      the component type for the DamageDataComponent component.
    • getLastCombatAction

      @Nonnull public Instant getLastCombatAction()
      Returns:
      the last time the entity performed a combat action.
    • setLastCombatAction

      public void setLastCombatAction(@Nonnull Instant lastCombatAction)
      Called to set the last combat action time.
      Parameters:
      lastCombatAction - The time to set as the last combat action.
    • getLastDamageTime

      @Nonnull public Instant getLastDamageTime()
      Returns:
      the last time the entity received damage.
    • setLastDamageTime

      public void setLastDamageTime(@Nonnull Instant lastDamageTime)
      Called to set the last damage time for the entity.
      Parameters:
      lastDamageTime - The time to set as the last damage time.
    • getLastChargeTime

      @Nullable public Instant getLastChargeTime()
      Returns:
      the last time the entity charged an attack, or null if never.
    • setLastChargeTime

      public void setLastChargeTime(@Nonnull Instant lastChargeTime)
      Called to set the last charge time for the entity.
      Parameters:
      lastChargeTime - The time to set as the last charge time.
    • getCurrentWielding

      @Nullable public WieldingInteraction getCurrentWielding()
      Returns:
      the current wielding interaction of the entity, or null if none.
    • setCurrentWielding

      public void setCurrentWielding(@Nullable WieldingInteraction currentWielding)
      Called to set the current wielding interaction of the entity.
      Parameters:
      currentWielding - The wielding interaction to set.
    • clone

      @Nonnull public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.