Package net.minecraft.entity.damage
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 - named - net/minecraft/entity/damage/DamageRecord- intermediary - net/minecraft/class_1281- official - bsx- named - damageSource- intermediary - comp_1535- official - a- named - damage- intermediary - comp_1536- official - b- named - fallLocation- intermediary - comp_1537- official - c- named - fallDistance- intermediary - comp_1538- official - d
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final floatThe field for thedamagerecord component.private final DamageSourceThe field for thedamageSourcerecord component.private final floatThe field for thefallDistancerecord component.private final @Nullable FallLocationThe field for thefallLocationrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionDamageRecord(DamageSource damageSource, float float2, @Nullable FallLocation fallLocation, float float3) 
- 
Method SummaryModifier and TypeMethodDescriptionfloatdamage()Returns the value of thedamagerecord component.Returns the value of thedamageSourcerecord component.final booleanIndicates whether some other object is "equal to" this one.floatReturns the value of thefallDistancerecord component.Returns the value of thefallLocationrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
damageSourceThe field for thedamageSourcerecord component.
- 
damageprivate final float damageThe field for thedamagerecord component.
- 
fallLocationThe field for thefallLocationrecord component.
- 
fallDistanceprivate final float fallDistanceThe field for thefallDistancerecord component.
 
- 
- 
Constructor Details- 
DamageRecordpublic DamageRecord(DamageSource damageSource, float float2, @Nullable @Nullable FallLocation fallLocation, float float3) - Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/entity/damage/DamageRecord;<init>(Lnet/minecraft/entity/damage/DamageSource;FLnet/minecraft/entity/damage/FallLocation;F)V- intermediary - <init>- Lnet/minecraft/class_1281;<init>(Lnet/minecraft/class_1282;FLnet/minecraft/class_8572;F)V- official - <init>- Lbsx;<init>(Lbtc;FLbth;F)V
 
 
- 
- 
Method Details- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 withObjects::equals(Object,Object); primitive components are compared with '=='.
- 
damageSourceReturns the value of thedamageSourcerecord component.- Returns:
- the value of the damageSourcerecord component
 
- 
damagepublic float damage()Returns the value of thedamagerecord component.- Returns:
- the value of the damagerecord component
 
- 
fallLocationReturns the value of thefallLocationrecord component.- Returns:
- the value of the fallLocationrecord component
 
- 
fallDistancepublic float fallDistance()Returns the value of thefallDistancerecord component.- Returns:
- the value of the fallDistancerecord component
 
 
-