ICapabilityProvider

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.

script.zs
import crafttweaker.api.capability.ICapabilityProvider;

Members

getCapability(cap as Capability<T>, side as Direction) as T?
Gets the capability for the given side.

Returns: The found capability or null.

script.zs
// ICapabilityProvider.getCapability<T>(cap as Capability<T>, side as Direction) as T?;
myICapabilityProvider.getCapability<T>(Capabilities.ENERGY, <constant:minecraft:direction:north>);

Parameters:

cap Type: Capability<T> - The capability to get.
side Type: Direction - The side to get the capability from, can be null.

Return Type: T?

getCapability(cap as Capability<T>) as T?
Gets the capability.

Returns: The found capability or null.

script.zs
// ICapabilityProvider.getCapability<T>(cap as Capability<T>) as T?;
myICapabilityProvider.getCapability<T>(Capabilities.ENERGY);

Parameters:

cap Type: Capability<T> - The capability to get.

Return Type: T?