Record Class DamageSourcePredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.DamageSourcePredicate
public record DamageSourcePredicate(List<TagPredicate<DamageType>> tags, Optional<EntityPredicate> directEntity, Optional<EntityPredicate> sourceEntity)
extends Record
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DamageSourcePredicate>private final Optional<EntityPredicate>The field for thedirectEntityrecord component.private final Optional<EntityPredicate>The field for thesourceEntityrecord component.private final List<TagPredicate<DamageType>>The field for thetagsrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionDamageSourcePredicate(List<TagPredicate<DamageType>> tags, Optional<EntityPredicate> directEntity, Optional<EntityPredicate> sourceEntity) Creates an instance of aDamageSourcePredicaterecord class.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the value of thedirectEntityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(ServerLevel p_25445_, Vec3 p_25446_, DamageSource p_25447_) booleanmatches(ServerPlayer p_25449_, DamageSource p_25450_) Returns the value of thesourceEntityrecord component.tags()Returns the value of thetagsrecord component.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
tagsThe field for thetagsrecord component.
- 
directEntityThe field for thedirectEntityrecord component.
- 
sourceEntityThe field for thesourceEntityrecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
DamageSourcePredicatepublic DamageSourcePredicate(List<TagPredicate<DamageType>> tags, Optional<EntityPredicate> directEntity, Optional<EntityPredicate> sourceEntity) Creates an instance of aDamageSourcePredicaterecord class.- Parameters:
- tags- the value for the- tagsrecord component
- directEntity- the value for the- directEntityrecord component
- sourceEntity- the value for the- sourceEntityrecord component
 
 
- 
- 
Method Details- 
matches
- 
matches
- 
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).
- 
tagsReturns the value of thetagsrecord component.- Returns:
- the value of the tagsrecord component
 
- 
directEntityReturns the value of thedirectEntityrecord component.- Returns:
- the value of the directEntityrecord component
 
- 
sourceEntityReturns the value of thesourceEntityrecord component.- Returns:
- the value of the sourceEntityrecord component
 
 
-