Importing the class

Link to importing-the-class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.neoforge.api.capability.ItemCapability;

Extending BaseCapability<T,C>

Link to extending-basecapabilitytc

ItemCapability extends BaseCapability<T,C>. That means all methods available in BaseCapability<T,C> are also available in ItemCapability

Name: getCapability

Return Type: @org.openzen.zencode.java.ZenCodeType.Nullable T

ZenScript
Copy
ItemCapability.getCapability<T : Object, U : Object>(entity as ItemStack, context as U) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
entity
Type
ItemStack
Parameter
context
Type
U
Parameter
T
Type
Object
Parameter
U
Type
Object