Record Class CombatEvent.Heal

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

public static record CombatEvent.Heal(net.minecraft.world.entity.LivingEntity entity, float amount, @Nullable net.minecraft.resources.Identifier type, 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
    Heal(net.minecraft.world.entity.LivingEntity entity, float amount, @Nullable net.minecraft.resources.Identifier type, Set<net.minecraft.resources.Identifier> flags)
    Creates an instance of a Heal record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Returns the value of the amount record component.
    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.
    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
     
    final String
    Returns a string representation of this record class.
    @Nullable net.minecraft.resources.Identifier
    Returns the value of the type record component.
    Optional<net.minecraft.resources.Identifier>
     
    float
     

    Methods inherited from class Object

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

    • Heal

      public Heal(net.minecraft.world.entity.LivingEntity entity, float amount, @Nullable net.minecraft.resources.Identifier type, Set<net.minecraft.resources.Identifier> flags)
      Creates an instance of a Heal record class.
      Parameters:
      entity - the value for the entity record component
      amount - the value for the amount record component
      type - the value for the type 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
    • amount

      public float amount()
      Returns the value of the amount record component.
      Returns:
      the value of the amount record component
    • type

      public @Nullable net.minecraft.resources.Identifier type()
      Returns the value of the type record component.
      Returns:
      the value of the type 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