Record Class DamageSourcePredicate

java.lang.Object
java.lang.Record
net.minecraft.predicate.entity.DamageSourcePredicate
Record Components:
tags -
directEntity -
sourceEntity -

public record DamageSourcePredicate(List<TagPredicate<DamageType>> tags, Optional<EntityPredicate> directEntity, Optional<EntityPredicate> sourceEntity) extends Record
Mappings:
Namespace Name
named net/minecraft/predicate/entity/DamageSourcePredicate
intermediary net/minecraft/class_2022
official bj
named tags
intermediary comp_1740
official b
named directEntity
intermediary comp_1741
official c
named sourceEntity
intermediary comp_1742
official d
  • Field Details

    • tags

      private final List<TagPredicate<DamageType>> tags
      The field for the tags record component.
    • directEntity

      private final Optional<EntityPredicate> directEntity
      The field for the directEntity record component.
    • sourceEntity

      private final Optional<EntityPredicate> sourceEntity
      The field for the sourceEntity record component.
    • CODEC

      public static final com.mojang.serialization.Codec<DamageSourcePredicate> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/predicate/entity/DamageSourcePredicate;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_45727 Lnet/minecraft/class_2022;field_45727:Lcom/mojang/serialization/Codec;
      official a Lbj;a:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • DamageSourcePredicate

      public DamageSourcePredicate(List<TagPredicate<DamageType>> tagPredicates, Optional<EntityPredicate> optional, Optional<EntityPredicate> optional2)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/predicate/entity/DamageSourcePredicate;<init>(Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
      intermediary <init> Lnet/minecraft/class_2022;<init>(Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
      official <init> Lbj;<init>(Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
  • Method Details

    • test

      public boolean test(ServerPlayerEntity player, DamageSource damageSource)
      Mappings:
      Namespace Name Mixin selector
      named test Lnet/minecraft/predicate/entity/DamageSourcePredicate;test(Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/entity/damage/DamageSource;)Z
      intermediary method_8847 Lnet/minecraft/class_2022;method_8847(Lnet/minecraft/class_3222;Lnet/minecraft/class_1282;)Z
      official a Lbj;a(Larg;Lbro;)Z
    • test

      public boolean test(ServerWorld world, Vec3d pos, DamageSource damageSource)
      Mappings:
      Namespace Name Mixin selector
      named test Lnet/minecraft/predicate/entity/DamageSourcePredicate;test(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/entity/damage/DamageSource;)Z
      intermediary method_8845 Lnet/minecraft/class_2022;method_8845(Lnet/minecraft/class_3218;Lnet/minecraft/class_243;Lnet/minecraft/class_1282;)Z
      official a Lbj;a(Larf;Levs;Lbro;)Z
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • tags

      public List<TagPredicate<DamageType>> tags()
      Returns the value of the tags record component.
      Returns:
      the value of the tags record component
    • directEntity

      public Optional<EntityPredicate> directEntity()
      Returns the value of the directEntity record component.
      Returns:
      the value of the directEntity record component
    • sourceEntity

      public Optional<EntityPredicate> sourceEntity()
      Returns the value of the sourceEntity record component.
      Returns:
      the value of the sourceEntity record component