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 beintermediary net/minecraft/class_2019named net/minecraft/predicate/DamagePredicateofficial aintermediary comp_1735named dealtofficial bintermediary comp_1736named takenofficial cintermediary comp_1737named sourceEntityofficial dintermediary comp_1738named blockedofficial eintermediary comp_1739named source
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theblockedrecord component.private final NumberRange.DoubleRangeThe field for thedealtrecord component.private final Optional<DamageSourcePredicate>The field for thesourcerecord component.private final Optional<EntityPredicate>The field for thesourceEntityrecord component.private final NumberRange.DoubleRangeThe field for thetakenrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDamagePredicate(NumberRange.DoubleRange dealt, NumberRange.DoubleRange taken, Optional<EntityPredicate> optional, Optional<Boolean> optional2, Optional<DamageSourcePredicate> optional3) -
Method Summary
Modifier and TypeMethodDescriptionblocked()Returns the value of theblockedrecord component.dealt()Returns the value of thedealtrecord component.final booleanIndicates whether some other object is "equal to" this one.static Optional<DamagePredicate>fromJson(@Nullable JsonElement json) final inthashCode()Returns a hash code value for this object.source()Returns the value of thesourcerecord component.Returns the value of thesourceEntityrecord component.taken()Returns the value of thetakenrecord component.booleantest(ServerPlayerEntity player, DamageSource source, float dealt, float taken, boolean blocked) toJson()final StringtoString()Returns a string representation of this record class.
-
Field Details
-
dealt
The field for thedealtrecord component. -
taken
The field for thetakenrecord component. -
sourceEntity
The field for thesourceEntityrecord component. -
blocked
The field for theblockedrecord component. -
source
The field for thesourcerecord 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;)Vintermediary <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;)Vnamed <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 aLbe;a(Lamb;Lbjg;FFZ)Zintermediary method_8838Lnet/minecraft/class_2019;method_8838(Lnet/minecraft/class_3222;Lnet/minecraft/class_1282;FFZ)Znamed testLnet/minecraft/predicate/DamagePredicate;test(Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/entity/damage/DamageSource;FFZ)Z
-
fromJson
- Mappings:
Namespace Name Mixin selector official aLbe;a(Lcom/google/gson/JsonElement;)Ljava/util/Optional;intermediary method_8839Lnet/minecraft/class_2019;method_8839(Lcom/google/gson/JsonElement;)Ljava/util/Optional;named fromJsonLnet/minecraft/predicate/DamagePredicate;fromJson(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
-
toJson
- Mappings:
Namespace Name Mixin selector official aLbe;a()Lcom/google/gson/JsonElement;intermediary method_8840Lnet/minecraft/class_2019;method_8840()Lcom/google/gson/JsonElement;named toJsonLnet/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 thedealtrecord component.- Returns:
- the value of the
dealtrecord component
-
taken
Returns the value of thetakenrecord component.- Returns:
- the value of the
takenrecord component
-
sourceEntity
Returns the value of thesourceEntityrecord component.- Returns:
- the value of the
sourceEntityrecord component
-
blocked
Returns the value of theblockedrecord component.- Returns:
- the value of the
blockedrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-