Record Class DataComponentPredicate.Potions
java.lang.Object
java.lang.Record
net.minestom.server.instance.block.predicate.DataComponentPredicate.Potions
- Record Components:
potionTypes- The types of potions to match. The object's potion type must be contained inpotionTypesfor this predicate to return true.
- All Implemented Interfaces:
Predicate<DataComponent.Holder>, DataComponentPredicate, DataComponentPredicate.Registered
- Enclosing interface:
DataComponentPredicate
public static record DataComponentPredicate.Potions(RegistryTag<PotionType> potionTypes)
extends Record
implements DataComponentPredicate.Registered
Tests stored potion types in the
DataComponents.POTION_CONTENTS component.-
Nested Class Summary
Nested classes/interfaces inherited from interface DataComponentPredicate
DataComponentPredicate.ArmorTrim, DataComponentPredicate.AttributeModifierPredicate, DataComponentPredicate.AttributeModifiers, DataComponentPredicate.BundleContents, DataComponentPredicate.Container, DataComponentPredicate.CustomData, DataComponentPredicate.Damage, DataComponentPredicate.EnchantmentListPredicate, DataComponentPredicate.Enchantments, DataComponentPredicate.Exists, DataComponentPredicate.FireworkExplosion, DataComponentPredicate.FireworkExplosionPredicate, DataComponentPredicate.Fireworks, DataComponentPredicate.JukeboxPlayable, DataComponentPredicate.Potions, DataComponentPredicate.Registered, DataComponentPredicate.StoredEnchantments, DataComponentPredicate.VillagerVariant, DataComponentPredicate.WritableBook, DataComponentPredicate.WrittenBook -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPotions(RegistryTag<PotionType> potionTypes) Creates an instance of aPotionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()Returns the codec registered for this predicate type.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thepotionTypesrecord component.booleantest(DataComponent.Holder holder) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
Potions
Creates an instance of aPotionsrecord class.- Parameters:
potionTypes- the value for thepotionTypesrecord component
-
-
Method Details
-
test
- Specified by:
testin interfacePredicate<DataComponent.Holder>
-
codec
Description copied from interface:DataComponentPredicate.RegisteredReturns the codec registered for this predicate type.- Specified by:
codecin interfaceDataComponentPredicate.Registered- Returns:
- the predicate codec
-
toString
-
hashCode
-
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). -
potionTypes
Returns the value of thepotionTypesrecord component.- Returns:
- the value of the
potionTypesrecord component
-