Record Class DamagePredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.DamagePredicate
public record DamagePredicate(MinMaxBounds.Doubles dealtDamage, MinMaxBounds.Doubles takenDamage, Optional<EntityPredicate> sourceEntity, Optional<Boolean> blocked, Optional<DamageSourcePredicate> type)
extends Record
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe field for theblockedrecord component.static final com.mojang.serialization.Codec<DamagePredicate>private final MinMaxBounds.DoublesThe field for thedealtDamagerecord component.private final Optional<EntityPredicate>The field for thesourceEntityrecord component.private final MinMaxBounds.DoublesThe field for thetakenDamagerecord component.private final Optional<DamageSourcePredicate>The field for thetyperecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionDamagePredicate(MinMaxBounds.Doubles dealtDamage, MinMaxBounds.Doubles takenDamage, Optional<EntityPredicate> sourceEntity, Optional<Boolean> blocked, Optional<DamageSourcePredicate> type) Creates an instance of aDamagePredicaterecord class.
- 
Method SummaryModifier and TypeMethodDescriptionblocked()Returns the value of theblockedrecord component.Returns the value of thedealtDamagerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(ServerPlayer p_24918_, DamageSource p_24919_, float p_24920_, float p_24921_, boolean p_24922_) Returns the value of thesourceEntityrecord component.Returns the value of thetakenDamagerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
- 
Field Details- 
dealtDamageThe field for thedealtDamagerecord component.
- 
takenDamageThe field for thetakenDamagerecord component.
- 
sourceEntityThe field for thesourceEntityrecord component.
- 
blockedThe field for theblockedrecord component.
- 
typeThe field for thetyperecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
DamagePredicatepublic DamagePredicate(MinMaxBounds.Doubles dealtDamage, MinMaxBounds.Doubles takenDamage, Optional<EntityPredicate> sourceEntity, Optional<Boolean> blocked, Optional<DamageSourcePredicate> type) Creates an instance of aDamagePredicaterecord class.- Parameters:
- dealtDamage- the value for the- dealtDamagerecord component
- takenDamage- the value for the- takenDamagerecord component
- sourceEntity- the value for the- sourceEntityrecord component
- blocked- the value for the- blockedrecord component
- type- the value for the- typerecord component
 
 
- 
- 
Method Details- 
matchespublic boolean matches(ServerPlayer p_24918_, DamageSource p_24919_, float p_24920_, float p_24921_, boolean p_24922_) 
- 
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. All components in this record class are compared withObjects::equals(Object,Object).
- 
dealtDamageReturns the value of thedealtDamagerecord component.- Returns:
- the value of the dealtDamagerecord component
 
- 
takenDamageReturns the value of thetakenDamagerecord component.- Returns:
- the value of the takenDamagerecord component
 
- 
sourceEntityReturns the value of thesourceEntityrecord component.- Returns:
- the value of the sourceEntityrecord component
 
- 
blockedReturns the value of theblockedrecord component.- Returns:
- the value of the blockedrecord component
 
- 
typeReturns the value of thetyperecord component.- Returns:
- the value of the typerecord component
 
 
-