Record Class KilledByCrossbowTrigger.TriggerInstance
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.KilledByCrossbowTrigger.TriggerInstance
- All Implemented Interfaces:
SimpleCriterionTrigger.SimpleInstance
,CriterionTriggerInstance
- Enclosing class:
- KilledByCrossbowTrigger
public static record KilledByCrossbowTrigger.TriggerInstance(Optional<ContextAwarePredicate> player, List<ContextAwarePredicate> victims, MinMaxBounds.Ints uniqueEntityTypes)
extends Record
implements SimpleCriterionTrigger.SimpleInstance
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<KilledByCrossbowTrigger.TriggerInstance>
private final Optional<ContextAwarePredicate>
The field for theplayer
record component.private final MinMaxBounds.Ints
The field for theuniqueEntityTypes
record component.private final List<ContextAwarePredicate>
The field for thevictims
record component. -
Constructor Summary
ConstructorDescriptionTriggerInstance
(Optional<ContextAwarePredicate> player, List<ContextAwarePredicate> victims, MinMaxBounds.Ints uniqueEntityTypes) Creates an instance of aTriggerInstance
record class. -
Method Summary
Modifier and TypeMethodDescriptioncrossbowKilled
(EntityPredicate.Builder... p_46901_) crossbowKilled
(MinMaxBounds.Ints p_46894_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
matches
(Collection<LootContext> p_46898_, int p_46899_) player()
Returns the value of theplayer
record component.final String
toString()
Returns a string representation of this record class.Returns the value of theuniqueEntityTypes
record component.void
validate
(CriterionValidator p_311777_) victims()
Returns the value of thevictims
record component.
-
Field Details
-
player
The field for theplayer
record component. -
victims
The field for thevictims
record component. -
uniqueEntityTypes
The field for theuniqueEntityTypes
record component. -
CODEC
-
-
Constructor Details
-
TriggerInstance
public TriggerInstance(Optional<ContextAwarePredicate> player, List<ContextAwarePredicate> victims, MinMaxBounds.Ints uniqueEntityTypes) Creates an instance of aTriggerInstance
record class.- Parameters:
player
- the value for theplayer
record componentvictims
- the value for thevictims
record componentuniqueEntityTypes
- the value for theuniqueEntityTypes
record component
-
-
Method Details
-
crossbowKilled
public static Criterion<KilledByCrossbowTrigger.TriggerInstance> crossbowKilled(EntityPredicate.Builder... p_46901_) -
crossbowKilled
public static Criterion<KilledByCrossbowTrigger.TriggerInstance> crossbowKilled(MinMaxBounds.Ints p_46894_) -
matches
-
validate
- Specified by:
validate
in interfaceCriterionTriggerInstance
- Specified by:
validate
in interfaceSimpleCriterionTrigger.SimpleInstance
-
player
Returns the value of theplayer
record component.- Specified by:
player
in interfaceSimpleCriterionTrigger.SimpleInstance
- Returns:
- the value of the
player
record component
-
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)
. -
victims
Returns the value of thevictims
record component.- Returns:
- the value of the
victims
record component
-
uniqueEntityTypes
Returns the value of theuniqueEntityTypes
record component.- Returns:
- the value of the
uniqueEntityTypes
record component
-