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

Extending BaseCapability<T,C>

Link to extending-basecapabilitytc

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

Name: getCapability

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

ZenScript
Copy
BlockCapability.getCapability<T : Object, U : Object>(level as Level, pos as BlockPos, state as BlockState, blockEntity as BlockEntity, context as U) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
level
Type
Level
Parameter
pos
Type
BlockPos
Parameter
state
Type
BlockState
Parameter
blockEntity
Type
BlockEntity
Parameter
context
Type
U
Parameter
T
Type
Object
Parameter
U
Type
Object