public interface ItemType extends CatalogType, Translatable
Modifier and Type | Method and Description |
---|---|
Optional<BlockType> |
getBlock()
Gets the corresponding
BlockType of this item if one exists. |
<T extends Property<?,?>> |
getDefaultProperty(Class<T> propertyClass)
|
int |
getMaxStackQuantity()
Get the default maximum quantity for
ItemStack s of this item. |
String |
getName()
Gets the id of this item.
|
getId
getTranslation
Optional<BlockType> getBlock()
BlockType
of this item if one exists.String getName()
Ex. Minecraft registers a golden carrot as "minecraft:golden_carrot".
getName
in interface CatalogType
int getMaxStackQuantity()
ItemStack
s of this item.<T extends Property<?,?>> Optional<T> getDefaultProperty(Class<T> propertyClass)
Property
of this ItemType
.
While item stacks do have properties, generally, there is an intrinsic default property for many item types. However, it should be considered that when mods are introducing their own custom items, they too could introduce different item properties based on various data on the item stack. The default properties retrieved from here should merely be considered as a default, not as a definitive property.
T
- The type of item propertypropertyClass
- The item property class