Record Class DamageRecord

java.lang.Object
java.lang.Record
net.minecraft.entity.damage.DamageRecord
Record Components:
damageSource -
damage -
fallLocation -
fallDistance -

public record DamageRecord(DamageSource damageSource, float damage, @Nullable FallLocation fallLocation, float fallDistance) extends Record
Mappings:
Namespace Name
official bei
intermediary net/minecraft/class_1281
named net/minecraft/entity/damage/DamageRecord
official a
intermediary comp_1535
named damageSource
official b
intermediary comp_1536
named damage
official c
intermediary comp_1537
named fallLocation
official d
intermediary comp_1538
named fallDistance
  • Field Details

  • Constructor Details

    • DamageRecord

      public DamageRecord(DamageSource damageSource, float float2, @Nullable @Nullable FallLocation fallLocation, float float3)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lbei;<init>(Lben;FLbes;F)V
      intermediary <init> Lnet/minecraft/class_1281;<init>(Lnet/minecraft/class_1282;FLnet/minecraft/class_8572;F)V
      named <init> Lnet/minecraft/entity/damage/DamageRecord;<init>(Lnet/minecraft/entity/damage/DamageSource;FLnet/minecraft/entity/damage/FallLocation;F)V
  • Method Details

    • 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 object)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • damageSource

      public DamageSource damageSource()
      Returns the value of the damageSource record component.
      Returns:
      the value of the damageSource record component
    • damage

      public float damage()
      Returns the value of the damage record component.
      Returns:
      the value of the damage record component
    • fallLocation

      @Nullable public @Nullable FallLocation fallLocation()
      Returns the value of the fallLocation record component.
      Returns:
      the value of the fallLocation record component
    • fallDistance

      public float fallDistance()
      Returns the value of the fallDistance record component.
      Returns:
      the value of the fallDistance record component