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 correspondingBlockType
of this item if one exists.Gets the container item of this item if one exists.boolean
Returns true if this type is any of the given item typesboolean
Returns true if this type is any of the given item typesint
Gets the default maximum quantity forItemStack
s of this item.rarity()
Gets the defaultItemRarity
for thisItemType
.Methods inherited from interface net.kyori.adventure.text.ComponentLike
asComponent
Methods inherited from interface org.spongepowered.api.data.DataHolder.Immutable
mergeWith, mergeWith, transform, transform, with, with, with, without, without, without
Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
Methods inherited from interface org.spongepowered.api.tag.Taggable
is, registryType, tags
-
Method Details
-
block
Gets the correspondingBlockType
of this item if one exists.- Returns:
- The Block
-
container
Gets the container item of this item if one exists.e.g.
ItemTypes.BUCKET
forItemTypes.WATER_BUCKET
- Returns:
- The container item.
-
maxStackQuantity
int maxStackQuantity()Gets the default maximum quantity forItemStack
s of this item.- Returns:
- Max stack quantity
-
rarity
ItemRarity rarity()Gets the defaultItemRarity
for 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
-