Record Class DamagePredicate

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

public record DamagePredicate(NumberRange.FloatRange dealt, NumberRange.FloatRange taken, Optional<EntityPredicate> sourceEntity, Optional<Boolean> blocked, Optional<DamageSourcePredicate> type) extends Record
Mappings:
Namespace Name
official bc
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 type
  • Field Details

  • Constructor Details

    • DamagePredicate

      public DamagePredicate(NumberRange.FloatRange dealt, NumberRange.FloatRange taken, Optional<EntityPredicate> optional, Optional<Boolean> optional2, Optional<DamageSourcePredicate> optional3)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lbc;<init>(Lcj$c;Lcj$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$FloatRange;Lnet/minecraft/predicate/NumberRange$FloatRange;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V
  • Method Details

    • method_53112

      static Optional<DamagePredicate> method_53112(NumberRange.FloatRange floatRange, NumberRange.FloatRange floatRange2, Optional<EntityPredicate> optional, Optional<Boolean> optional2, Optional<DamageSourcePredicate> optional3)
      Mappings:
      Namespace Name Mixin selector
      official a Lbc;a(Lcj$c;Lcj$c;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)Ljava/util/Optional;
      intermediary method_53112 Lnet/minecraft/class_2019;method_53112(Lnet/minecraft/class_2096$class_2099;Lnet/minecraft/class_2096$class_2099;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)Ljava/util/Optional;
      named method_53112 Lnet/minecraft/predicate/DamagePredicate;method_53112(Lnet/minecraft/predicate/NumberRange$FloatRange;Lnet/minecraft/predicate/NumberRange$FloatRange;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)Ljava/util/Optional;
    • test

      public boolean test(ServerPlayerEntity serverPlayerEntity, DamageSource damageSource, float dealt, float taken, boolean blocked)
      Mappings:
      Namespace Name Mixin selector
      official a Lbc;a(Lakl;Lbhg;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 JsonElement json)
      Mappings:
      Namespace Name Mixin selector
      official a Lbc;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 JsonElement toJson()
      Mappings:
      Namespace Name Mixin selector
      official a Lbc;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.FloatRange dealt()
      Returns the value of the dealt record component.
      Returns:
      the value of the dealt record component
    • taken

      public NumberRange.FloatRange 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