Package org.spongepowered.api.item
Interface ItemType
- All Superinterfaces:
ComponentLike,DataHolder,DataHolder.Immutable<ItemType>,DefaultedRegistryValue,Taggable<ItemType>,ValueContainer
@CatalogedBy(ItemTypes.class)
public interface ItemType
extends DefaultedRegistryValue, ComponentLike, DataHolder.Immutable<ItemType>, Taggable<ItemType>
A type of item.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends 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 net.kyori.adventure.text.ComponentLike
asComponentMethods inherited from interface org.spongepowered.api.data.DataHolder.Immutable
mergeWith, mergeWith, transform, transform, with, with, with, without, without, withoutMethods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, keyMethods inherited from interface org.spongepowered.api.tag.Taggable
is, registryType, tags
-
Method Details
-
block
Gets the correspondingBlockTypeof this item if one exists.- Returns:
- The 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
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
-
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
-