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.
import crafttweaker.api.item.ItemStack;
Description
This is the vanilla ItemStack. It is recommended that you useIItemStack
whenever possible
They can be cast from each other, though.
Extends
ItemStack extends CapabilityProvider<ItemStack>
.
Implements
ItemStack
implements the following interfaces:
ICapabilityProviderImpl<ICapabilityProviderImpl>
,ICapabilityProvider
Undocumented Interfaces
IItemStackExtension
,ICapabilitySerializable<CompoundTag>
,INBTSerializable<Tag>
Members
asIIngredient() as IIngredient
implicit as IIngredient
// ItemStack as IIngredientmyItemStack as IIngredient
Return Type:
IIngredient
asIItemStack() as IItemStack
implicit as IItemStack
// ItemStack as IItemStackmyItemStack as IItemStack
Return Type:
IItemStack
getCapability(cap as Capability<T>, side as Direction) as T?
Gets the capability for the given side.script.zs
Returns: The found capability or null.
myItemStack.getCapability<T>(Capabilities.ENERGY, <constant:minecraft:direction:north>);
Parameters:
Return Type:
T?
getCapability(cap as Capability<T>) as T?
Gets the capability.script.zs
Returns: The found capability or null.
myItemStack.getCapability<T>(Capabilities.ENERGY);
Parameters:
Return Type:
T?