Record Class ItemDurabilityTrigger.TriggerInstance
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.ItemDurabilityTrigger.TriggerInstance
- All Implemented Interfaces:
- SimpleCriterionTrigger.SimpleInstance,- CriterionTriggerInstance
- Enclosing class:
- ItemDurabilityTrigger
public static record ItemDurabilityTrigger.TriggerInstance(Optional<ContextAwarePredicate> player, Optional<ItemPredicate> item, MinMaxBounds.Ints durability, MinMaxBounds.Ints delta)
extends Record
implements SimpleCriterionTrigger.SimpleInstance
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemDurabilityTrigger.TriggerInstance>private final MinMaxBounds.IntsThe field for thedeltarecord component.private final MinMaxBounds.IntsThe field for thedurabilityrecord component.private final Optional<ItemPredicate>The field for theitemrecord component.private final Optional<ContextAwarePredicate>The field for theplayerrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionTriggerInstance(Optional<ContextAwarePredicate> player, Optional<ItemPredicate> item, MinMaxBounds.Ints durability, MinMaxBounds.Ints delta) Creates an instance of aTriggerInstancerecord class.
- 
Method SummaryModifier and TypeMethodDescriptionchangedDurability(Optional<ContextAwarePredicate> p_299196_, Optional<ItemPredicate> p_299039_, MinMaxBounds.Ints p_286730_) changedDurability(Optional<ItemPredicate> p_299020_, MinMaxBounds.Ints p_151288_) delta()Returns the value of thedeltarecord component.Returns the value of thedurabilityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.item()Returns the value of theitemrecord component.booleanplayer()Returns the value of theplayerrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstancevalidate
- 
Field Details- 
playerThe field for theplayerrecord component.
- 
itemThe field for theitemrecord component.
- 
durabilityThe field for thedurabilityrecord component.
- 
deltaThe field for thedeltarecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
TriggerInstancepublic TriggerInstance(Optional<ContextAwarePredicate> player, Optional<ItemPredicate> item, MinMaxBounds.Ints durability, MinMaxBounds.Ints delta) Creates an instance of aTriggerInstancerecord class.- Parameters:
- player- the value for the- playerrecord component
- item- the value for the- itemrecord component
- durability- the value for the- durabilityrecord component
- delta- the value for the- deltarecord component
 
 
- 
- 
Method Details- 
changedDurabilitypublic static Criterion<ItemDurabilityTrigger.TriggerInstance> changedDurability(Optional<ItemPredicate> p_299020_, MinMaxBounds.Ints p_151288_) 
- 
changedDurabilitypublic static Criterion<ItemDurabilityTrigger.TriggerInstance> changedDurability(Optional<ContextAwarePredicate> p_299196_, Optional<ItemPredicate> p_299039_, MinMaxBounds.Ints p_286730_) 
- 
matches
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
playerReturns the value of theplayerrecord component.- Specified by:
- playerin interface- SimpleCriterionTrigger.SimpleInstance
- Returns:
- the value of the playerrecord component
 
- 
itemReturns the value of theitemrecord component.- Returns:
- the value of the itemrecord component
 
- 
durabilityReturns the value of thedurabilityrecord component.- Returns:
- the value of the durabilityrecord component
 
- 
deltaReturns the value of thedeltarecord component.- Returns:
- the value of the deltarecord component
 
 
-