Record Class DamagePredicate

java.lang.Object
java.lang.Record
net.minecraft.predicate.DamagePredicate
Record Components:
dealt -
taken -
sourceEntity -
blocked -
type -

public record DamagePredicate(NumberRange.DoubleRange dealt, NumberRange.DoubleRange taken, Optional<EntityPredicate> sourceEntity, Optional<Boolean> blocked, Optional<DamageSourcePredicate> type) extends Record
Mappings:
Namespace Name
official be
intermediary net/minecraft/class_2019
named net/minecraft/predicate/DamagePredicate
official b
intermediary comp_1735
named dealt
official c
intermediary comp_1736
named taken
official d
intermediary comp_1737
named sourceEntity
official e
intermediary comp_1738
named blocked
official f
intermediary comp_1739
named type
  • Field Details

    • dealt

      private final NumberRange.DoubleRange dealt
      The field for the dealt record component.
    • taken

      private final NumberRange.DoubleRange taken
      The field for the taken record component.
    • sourceEntity

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

      private final Optional<Boolean> blocked
      The field for the blocked record component.
    • type

      private final Optional<DamageSourcePredicate> type
      The field for the type record component.
    • CODEC

      public static final com.mojang.serialization.Codec<DamagePredicate> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Lbe;a:Lcom/mojang/serialization/Codec;
      intermediary field_47238 Lnet/minecraft/class_2019;field_47238:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/predicate/DamagePredicate;CODEC:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • DamagePredicate

      public DamagePredicate(NumberRange.DoubleRange dealt, NumberRange.DoubleRange taken, Optional<EntityPredicate> optional, Optional<Boolean> optional2, Optional<DamageSourcePredicate> optional3)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lbe;<init>(Lck$c;Lck$c;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V
      intermediary <init> Lnet/minecraft/class_2019;<init>(Lnet/minecraft/class_2096$class_2099;Lnet/minecraft/class_2096$class_2099;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V
      named <init> Lnet/minecraft/predicate/DamagePredicate;<init>(Lnet/minecraft/predicate/NumberRange$DoubleRange;Lnet/minecraft/predicate/NumberRange$DoubleRange;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V
  • Method Details

    • test

      public boolean test(ServerPlayerEntity player, DamageSource source, float dealt, float taken, boolean blocked)
      Mappings:
      Namespace Name Mixin selector
      official a Lbe;a(Lane;Lbkt;FFZ)Z
      intermediary method_8838 Lnet/minecraft/class_2019;method_8838(Lnet/minecraft/class_3222;Lnet/minecraft/class_1282;FFZ)Z
      named test Lnet/minecraft/predicate/DamagePredicate;test(Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/entity/damage/DamageSource;FFZ)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.
    • dealt

      public NumberRange.DoubleRange dealt()
      Returns the value of the dealt record component.
      Returns:
      the value of the dealt record component
    • taken

      public NumberRange.DoubleRange taken()
      Returns the value of the taken record component.
      Returns:
      the value of the taken record component
    • sourceEntity

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

      public Optional<Boolean> blocked()
      Returns the value of the blocked record component.
      Returns:
      the value of the blocked record component
    • type

      Returns the value of the type record component.
      Returns:
      the value of the type record component