Record Class CombatEvent.Damage

java.lang.Object
java.lang.Record
cromveil.combatnumbers.events.CombatEvent.Damage
All Implemented Interfaces:
CombatEvent
Enclosing interface:
CombatEvent

public static record CombatEvent.Damage(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.damagesource.DamageSource source, float rawDamage, float finalDamage, Set<net.minecraft.resources.Identifier> flags) extends Record implements CombatEvent
  • Nested Class Summary

    Nested classes/interfaces inherited from interface CombatEvent

    CombatEvent.Damage, CombatEvent.Heal
  • Field Summary

    Fields inherited from interface CombatEvent

    DAMAGE_KIND, GENERIC_HEAL, HEAL_KIND
  • Constructor Summary

    Constructors
    Constructor
    Description
    Damage(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.damagesource.DamageSource source, float rawDamage, float finalDamage, Set<net.minecraft.resources.Identifier> flags)
    Creates an instance of a Damage record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.entity.LivingEntity
    Returns the value of the entity record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    float
    Returns the value of the finalDamage record component.
    Set<net.minecraft.resources.Identifier>
    Returns the value of the flags record component.
    final int
    Returns a hash code value for this object.
    net.minecraft.resources.Identifier
     
    float
    Returns the value of the rawDamage record component.
    net.minecraft.world.damagesource.DamageSource
    Returns the value of the source record component.
    final String
    Returns a string representation of this record class.
    Optional<net.minecraft.resources.Identifier>
     
    float
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Damage

      public Damage(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.damagesource.DamageSource source, float rawDamage, float finalDamage, Set<net.minecraft.resources.Identifier> flags)
      Creates an instance of a Damage record class.
      Parameters:
      entity - the value for the entity record component
      source - the value for the source record component
      rawDamage - the value for the rawDamage record component
      finalDamage - the value for the finalDamage record component
      flags - the value for the flags record component
  • Method Details

    • kind

      public net.minecraft.resources.Identifier kind()
      Specified by:
      kind in interface CombatEvent
    • value

      public float value()
      Specified by:
      value in interface CombatEvent
    • typeKey

      public Optional<net.minecraft.resources.Identifier> typeKey()
      Specified by:
      typeKey in interface CombatEvent
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • entity

      public net.minecraft.world.entity.LivingEntity entity()
      Returns the value of the entity record component.
      Specified by:
      entity in interface CombatEvent
      Returns:
      the value of the entity record component
    • source

      public net.minecraft.world.damagesource.DamageSource source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • rawDamage

      public float rawDamage()
      Returns the value of the rawDamage record component.
      Returns:
      the value of the rawDamage record component
    • finalDamage

      public float finalDamage()
      Returns the value of the finalDamage record component.
      Returns:
      the value of the finalDamage record component
    • flags

      public Set<net.minecraft.resources.Identifier> flags()
      Returns the value of the flags record component.
      Specified by:
      flags in interface CombatEvent
      Returns:
      the value of the flags record component