NeoForgeIItemStackExpansions

Expands

This class expands IItemStack, meaning that the content found on this page can be called on that type directly.

Members

canPerformAction(action as ItemAbility) as bool
Checks if this item can perform the given ItemAbility.

Returns: True if it can perform the action, false otherwise.

script.zs
// IItemStack.canPerformAction(action as ItemAbility) as bool;
myIItemStack.canPerformAction(myItemAbility);

Parameters:

action Type: ItemAbility - The action to perform.

Return Type: bool

getBurnTime(manager as IRecipeManager<?>) as int
script.zs
// IItemStack.getBurnTime(manager as IRecipeManager<?>) as int;
myIItemStack.getBurnTime(myIRecipeManager);

Parameters:

manager Type: IRecipeManager<?>

Return Type: int

getCapability(cap as ItemCapability<Void, T>) as T?
script.zs
// IItemStack.getCapability<T>(cap as ItemCapability<Void, T>) as T?;
myIItemStack.getCapability<T>(myItemCapability);

Parameters:

cap Type: ItemCapability<Void, T>

Return Type: T?

getCapabilityWithContext(cap as ItemCapability<C, T>, context as C?) as T?
script.zs
// IItemStack.getCapabilityWithContext<C, T>(cap as ItemCapability<C, T>, context as C?) as T?;
myIItemStack.getCapabilityWithContext<C, T>(myItemCapability, myC);

Parameters:

cap Type: ItemCapability<C, T>
context Type: C?

Return Type: T?

setBurnTime(time as int, manager as IRecipeManager<?>)
Sets the burn time of this ingredient, for use in the furnace and other machines
script.zs
// IItemStack.setBurnTime(time as int, manager as IRecipeManager<?>);
myIItemStack.setBurnTime(500, myIRecipeManager);

Parameters:

time Type: int - the new burn time
manager Type: IRecipeManager<?>