Package net.minecraft.predicate
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
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionThe field for theblocked
record component.private final NumberRange.DoubleRange
The field for thedealt
record component.private final Optional<DamageSourcePredicate>
The field for thesource
record component.private final Optional<EntityPredicate>
The field for thesourceEntity
record component.private final NumberRange.DoubleRange
The field for thetaken
record component. -
Constructor Summary
ConstructorDescriptionDamagePredicate
(NumberRange.DoubleRange dealt, NumberRange.DoubleRange taken, Optional<EntityPredicate> optional, Optional<Boolean> optional2, Optional<DamageSourcePredicate> optional3) -
Method Summary
Modifier and TypeMethodDescriptionblocked()
Returns the value of theblocked
record component.dealt()
Returns the value of thedealt
record component.final boolean
Indicates whether some other object is "equal to" this one.static Optional<DamagePredicate>
fromJson
(@Nullable com.google.gson.JsonElement json) final int
hashCode()
Returns a hash code value for this object.source()
Returns the value of thesource
record component.Returns the value of thesourceEntity
record component.taken()
Returns the value of thetaken
record component.boolean
test
(ServerPlayerEntity player, DamageSource source, float dealt, float taken, boolean blocked) com.google.gson.JsonElement
toJson()
final String
toString()
Returns a string representation of this record class.
-
Field Details
-
dealt
The field for thedealt
record component. -
taken
The field for thetaken
record component. -
sourceEntity
The field for thesourceEntity
record component. -
blocked
The field for theblocked
record component. -
source
The field for thesource
record component.
-
-
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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
dealt
Returns the value of thedealt
record component.- Returns:
- the value of the
dealt
record component
-
taken
Returns the value of thetaken
record component.- Returns:
- the value of the
taken
record component
-
sourceEntity
Returns the value of thesourceEntity
record component.- Returns:
- the value of the
sourceEntity
record component
-
blocked
Returns the value of theblocked
record component.- Returns:
- the value of the
blocked
record component
-
source
Returns the value of thesource
record component.- Returns:
- the value of the
source
record component
-