Package net.minecraft.predicate.entity
Record Class DamageSourcePredicate
java.lang.Object
java.lang.Record
net.minecraft.predicate.entity.DamageSourcePredicate
- Record Components:
tagPredicates
-directEntity
-sourceEntity
-
public record DamageSourcePredicate(List<TagPredicate<DamageType>> tagPredicates, Optional<EntityPredicate> directEntity, Optional<EntityPredicate> sourceEntity)
extends Record
- Mappings:
Namespace Name official bf
intermediary net/minecraft/class_2022
named net/minecraft/predicate/entity/DamageSourcePredicate
official b
intermediary comp_1740
named tagPredicates
official c
intermediary comp_1741
named directEntity
official d
intermediary comp_1742
named sourceEntity
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DamageSourcePredicate>
private final Optional<EntityPredicate>
The field for thedirectEntity
record component.private final Optional<EntityPredicate>
The field for thesourceEntity
record component.private final List<TagPredicate<DamageType>>
The field for thetagPredicates
record component. -
Constructor Summary
ConstructorDescriptionDamageSourcePredicate
(List<TagPredicate<DamageType>> tagPredicates, Optional<EntityPredicate> optional, Optional<EntityPredicate> optional2) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedirectEntity
record component.final boolean
Indicates whether some other object is "equal to" this one.static Optional<DamageSourcePredicate>
fromJson
(@Nullable JsonElement json) final int
hashCode()
Returns a hash code value for this object.Returns the value of thesourceEntity
record component.Returns the value of thetagPredicates
record component.boolean
test
(ServerPlayerEntity player, DamageSource damageSource) boolean
test
(ServerWorld world, Vec3d pos, DamageSource damageSource) toJson()
final String
toString()
Returns a string representation of this record class.
-
Field Details
-
tagPredicates
The field for thetagPredicates
record component. -
directEntity
The field for thedirectEntity
record component. -
sourceEntity
The field for thesourceEntity
record component. -
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lbf;a:Lcom/mojang/serialization/Codec;
intermediary field_45727
Lnet/minecraft/class_2022;field_45727:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/predicate/entity/DamageSourcePredicate;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
DamageSourcePredicate
public DamageSourcePredicate(List<TagPredicate<DamageType>> tagPredicates, Optional<EntityPredicate> optional, Optional<EntityPredicate> optional2) - Mappings:
Namespace Name Mixin selector official <init>
Lbf;<init>(Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
intermediary <init>
Lnet/minecraft/class_2022;<init>(Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
named <init>
Lnet/minecraft/predicate/entity/DamageSourcePredicate;<init>(Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
-
-
Method Details
-
test
- Mappings:
Namespace Name Mixin selector official a
Lbf;a(Lakr;Lbho;)Z
intermediary method_8847
Lnet/minecraft/class_2022;method_8847(Lnet/minecraft/class_3222;Lnet/minecraft/class_1282;)Z
named test
Lnet/minecraft/predicate/entity/DamageSourcePredicate;test(Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/entity/damage/DamageSource;)Z
-
test
- Mappings:
Namespace Name Mixin selector official a
Lbf;a(Lakq;Lehn;Lbho;)Z
intermediary method_8845
Lnet/minecraft/class_2022;method_8845(Lnet/minecraft/class_3218;Lnet/minecraft/class_243;Lnet/minecraft/class_1282;)Z
named test
Lnet/minecraft/predicate/entity/DamageSourcePredicate;test(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/entity/damage/DamageSource;)Z
-
fromJson
- Mappings:
Namespace Name Mixin selector official a
Lbf;a(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
intermediary method_8846
Lnet/minecraft/class_2022;method_8846(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
named fromJson
Lnet/minecraft/predicate/entity/DamageSourcePredicate;fromJson(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
-
toJson
- Mappings:
Namespace Name Mixin selector official a
Lbf;a()Lcom/google/gson/JsonElement;
intermediary method_8848
Lnet/minecraft/class_2022;method_8848()Lcom/google/gson/JsonElement;
named toJson
Lnet/minecraft/predicate/entity/DamageSourcePredicate;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)
. -
tagPredicates
Returns the value of thetagPredicates
record component.- Returns:
- the value of the
tagPredicates
record component
-
directEntity
Returns the value of thedirectEntity
record component.- Returns:
- the value of the
directEntity
record component
-
sourceEntity
Returns the value of thesourceEntity
record component.- Returns:
- the value of the
sourceEntity
record component
-