Package net.minecraft.world.damagesource
Record Class CombatEntry
java.lang.Object
java.lang.Record
net.minecraft.world.damagesource.CombatEntry
public record CombatEntry(DamageSource source, float damage, @Nullable FallLocation fallLocation, float fallDistance)
extends Record
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final floatThe field for thedamagerecord component.private final floatThe field for thefallDistancerecord component.private final FallLocationThe field for thefallLocationrecord component.private final DamageSourceThe field for thesourcerecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionCombatEntry(DamageSource source, float damage, FallLocation fallLocation, float fallDistance) Creates an instance of aCombatEntryrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionfloatdamage()Returns the value of thedamagerecord 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.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
sourceThe field for thesourcerecord component.
- 
damageprivate final float damageThe field for thedamagerecord component.
- 
fallLocationThe field for thefallLocationrecord component.
- 
fallDistanceprivate final float fallDistanceThe field for thefallDistancerecord component.
 
- 
- 
Constructor Details- 
CombatEntrypublic CombatEntry(DamageSource source, float damage, @Nullable FallLocation fallLocation, float fallDistance) Creates an instance of aCombatEntryrecord class.- Parameters:
- source- the value for the- sourcerecord component
- damage- the value for the- damagerecord component
- fallLocation- the value for the- fallLocationrecord component
- fallDistance- the value for the- fallDistancerecord component
 
 
- 
- 
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 '=='.
- 
sourceReturns the value of thesourcerecord component.- Returns:
- the value of the sourcerecord 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
 
 
-