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 Summary
Modifier and TypeFieldDescriptionprivate final float
The field for thedamage
record component.private final float
The field for thefallDistance
record component.private final FallLocation
The field for thefallLocation
record component.private final DamageSource
The field for thesource
record component. -
Constructor Summary
ConstructorDescriptionCombatEntry
(DamageSource source, float damage, FallLocation fallLocation, float fallDistance) Creates an instance of aCombatEntry
record class. -
Method Summary
Modifier and TypeMethodDescriptionfloat
damage()
Returns the value of thedamage
record component.final boolean
Indicates whether some other object is "equal to" this one.float
Returns the value of thefallDistance
record component.Returns the value of thefallLocation
record component.final int
hashCode()
Returns a hash code value for this object.source()
Returns the value of thesource
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
source
The field for thesource
record component. -
damage
private final float damageThe field for thedamage
record component. -
fallLocation
The field for thefallLocation
record component. -
fallDistance
private final float fallDistanceThe field for thefallDistance
record component.
-
-
Constructor Details
-
CombatEntry
public CombatEntry(DamageSource source, float damage, @Nullable FallLocation fallLocation, float fallDistance) Creates an instance of aCombatEntry
record class.- Parameters:
source
- the value for thesource
record componentdamage
- the value for thedamage
record componentfallLocation
- the value for thefallLocation
record componentfallDistance
- the value for thefallDistance
record component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
source
Returns the value of thesource
record component.- Returns:
- the value of the
source
record component
-
damage
public float damage()Returns the value of thedamage
record component.- Returns:
- the value of the
damage
record component
-
fallLocation
Returns the value of thefallLocation
record component.- Returns:
- the value of the
fallLocation
record component
-
fallDistance
public float fallDistance()Returns the value of thefallDistance
record component.- Returns:
- the value of the
fallDistance
record component
-