Record Class DamagePredicate

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

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

  • 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>(Lcl$c;Lcl$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(Lakr;Lbho;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
    • fromJson

      public static Optional<DamagePredicate> fromJson(@Nullable @Nullable com.google.gson.JsonElement json)
      Mappings:
      Namespace Name Mixin selector
      official a Lbe;a(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
      intermediary method_8839 Lnet/minecraft/class_2019;method_8839(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
      named fromJson Lnet/minecraft/predicate/DamagePredicate;fromJson(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
    • toJson

      public com.google.gson.JsonElement toJson()
      Mappings:
      Namespace Name Mixin selector
      official a Lbe;a()Lcom/google/gson/JsonElement;
      intermediary method_8840 Lnet/minecraft/class_2019;method_8840()Lcom/google/gson/JsonElement;
      named toJson Lnet/minecraft/predicate/DamagePredicate;toJson()Lcom/google/gson/JsonElement;
    • 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
    • source

      public Optional<DamageSourcePredicate> source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component