Interface ItemType
- All Superinterfaces:
ComponentLike, DataHolder, DataHolder.Immutable<ItemType>, DefaultedRegistryValue<ItemType>, Taggable<ItemType>, ValueContainer
@CatalogedBy(ItemTypes.class)
public interface ItemType
extends DefaultedRegistryValue<ItemType>, ComponentLike, DataHolder.Immutable<ItemType>, Taggable<ItemType>
A type of item.
-
Nested Class Summary
Nested classes/interfaces inherited from interface DataHolder
DataHolder.Immutable<I>, DataHolder.Mutable -
Method Summary
Modifier and TypeMethodDescriptionblock()Gets the correspondingBlockTypeof this item if one exists.Gets the container item of this item if one exists.booleanReturns true if this type is any of the given item typesbooleanReturns true if this type is any of the given item typesintGets the default maximum quantity forItemStacks of this item.rarity()Gets the defaultItemRarityfor thisItemType.Methods inherited from interface ComponentLike
asComponentMethods inherited from interface DataHolder.Immutable
mergeWith, mergeWith, transform, transform, with, with, with, without, without, withoutMethods inherited from interface DefaultedRegistryValue
asDefaultedReference, findKey, keyMethods inherited from interface ValueContainer
get, getDouble, getInt, getKeys, getLong, getOrElse, getOrNull, getValue, getValues, require, requireValue, streamKeys, streamValues, supports, supports
-
Method Details
-
block
-
container
Gets the container item of this item if one exists.e.g.
ItemTypes.BUCKETforItemTypes.WATER_BUCKET- Returns:
- The container item.
-
maxStackQuantity
int maxStackQuantity()Gets the default maximum quantity forItemStacks of this item.- Returns:
- Max stack quantity
-
rarity
ItemRarity rarity()Gets the defaultItemRarityfor thisItemType.- Returns:
- The default rarity for the item type.
-
isAnyOf
-
isAnyOf
Returns true if this type is any of the given item types- Parameters:
types- the item types to check- Returns:
- true if this type is any of the given item types
-