EntityCapability

Link to entitycapability

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.EntityCapability;

Extending BaseCapability<T,C>

Link to extending-basecapabilitytc

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

Name: getCapability

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

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