Package net.minecraft.predicate
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 bcintermediary 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 type
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theblockedrecord component.private final NumberRange.FloatRangeThe field for thedealtrecord component.private final Optional<EntityPredicate>The field for thesourceEntityrecord component.private final NumberRange.FloatRangeThe field for thetakenrecord component.private final Optional<DamageSourcePredicate>The field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDamagePredicate(NumberRange.FloatRange dealt, NumberRange.FloatRange 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.(package private) static Optional<DamagePredicate>method_53112(NumberRange.FloatRange floatRange, NumberRange.FloatRange floatRange2, Optional<EntityPredicate> optional, Optional<Boolean> optional2, Optional<DamageSourcePredicate> optional3) Returns the value of thesourceEntityrecord component.taken()Returns the value of thetakenrecord component.booleantest(ServerPlayerEntity serverPlayerEntity, DamageSource damageSource, float dealt, float taken, boolean blocked) toJson()final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
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. -
type
The field for thetyperecord component.
-
-
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;)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$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 aLbc;a(Lcj$c;Lcj$c;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)Ljava/util/Optional;intermediary method_53112Lnet/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_53112Lnet/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 aLbc;a(Lakl;Lbhg;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 aLbc;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 aLbc;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
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-