ItemStack
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
Description
This is the vanilla ItemStack. It is recommended that you useIItemStack
whenever possible
They can be cast from each other, though.
Implements
ItemStack
implements the following interfaces:
DataComponentHolder
,MutableDataComponentHolder
Undocumented Interfaces
IItemStackExtension
,IDataComponentHolderExtension
Operators
Parameters:
Return Type:
bool
Members
Parameters:
components: DataComponentMap
Type: DataComponentMap
Parameters:
patch: DataComponentPatch
Type: DataComponentPatch
Return Type:
IIngredient
Return Type:
IIngredient
Return Type:
IItemStack
Return Type:
IItemStack
Return Type:
DataComponentMap
Parameters:
src: DataComponentHolder
Type: DataComponentHolder
componentTypes: DataComponentType<?>[]
Type: DataComponentType<?>[]
Returns: The value if it exists or null.
Parameters:
Return Type:
T
If the ComponentAccess does not have the type, an exception is thrown. If the ComponentAccess is not serializable, an exception is thrown.
Returns: A IData
representation of the Serialized DataComponent
Parameters:
Return Type:
IData
Returns: The value if it exists or the default value.
Parameters:
defaultValue: T
Type: T
- The default value to return in the event that the holder does not have the component.
Return Type:
T
Returns: Whether the holder contains the DataComponent.
Parameters:
Return Type:
bool
Parameters:
componentType: DataComponentType<T>
Type: DataComponentType<T>
Return Type:
T?
Parameters:
componentType: DataComponentType<T>
Type: DataComponentType<T>
value: T?
Type: T?
Return Type:
T?
Parameters:
componentType: DataComponentType<T>
Type: DataComponentType<T>
value: T
Type: T
updater: UnaryOperator<T>
Type: UnaryOperator<T>
Return Type:
T?
Parameters:
componentType: DataComponentType<T>
Type: DataComponentType<T>
value: T
Type: T
updateContext: U
Type: U
updater: BiFunction<T, T, U>
Type: BiFunction<T, T, U>
Return Type:
T?