IItemHandler
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.neoforge.api.capability.IItemHandler;Operators
// IItemHandler[slot as int] as IItemStackmyIItemHandler[myInt]Parameters:
slot: int  Type: int 
- The slot to get the stack of.   
Return Type:
IItemStack
Members
Returns: The stack extracted from the slot.
myIItemHandler.extractItem(0, 5, false);Parameters:
slot: int  Type: int 
- The slot to extract from.   amount: int  Type: int 
- How much to extract from the slot.   simulate: bool  Type: bool 
- If the extraction should actually happen, if true, no changes will be made.   
Return Type:
IItemStack
Returns: The max stack size of the given stack.
// IItemHandler.getSlotLimit(slot as int) as int;myIItemHandler.getSlotLimit(1);Parameters:
slot: int  Type: int 
- The slot to check.   
Return Type:
int
Returns: The stack in the slot.
myIItemHandler.getStackInSlot(1);Parameters:
slot: int  Type: int 
- The slot to get the stack of.   
Return Type:
IItemStack
 
The remainder returned is how much was not inserted.  
 
For example if slot 0 had 63 dirt, and you tried to insert 5 dirt, you will get a remainder of 4 dirt.  
Returns: The remaining stack that was not inserted.
myIItemHandler.insertItem(1, <item:minecraft:dirt>, true);Parameters:
slot: int  Type: int 
- The slot to insert into.   simulate: bool  Type: bool 
- If the insert should actually happen, if true, will be made.   
Return Type:
IItemStack
Returns: true if the stack is valid, false otherwise.
myIItemHandler.isItemValid(myInt, myIItemStack);Parameters:
slot: int  Type: int 
- The slot to check.   
Return Type:
bool
// IItemHandler.slots as intmyIItemHandler.slots
Return Type:
int