Expansion for IItemStack

Link to expansion-for-iitemstack

Link to canPerformAction

Name: canPerformAction

Checks if this item can perform the given ToolAction.

Returns: True if it can perform the action, false otherwise.
Return Type: boolean

ZenScript
Copy
IItemStack.canPerformAction(action as ToolAction) as boolean
ParameterTypeDescription
Parameter
action
Type
ToolAction
Description
The action to perform.

Name: getCapability

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

ZenScript
Copy
IItemStack.getCapability<T : Object>(cap as ItemCapability<T,Void>) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
cap
Type
ItemCapability<T,Void>
Parameter
T
Type
Object

Link to getCapabilityWithContext

Name: getCapabilityWithContext

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

ZenScript
Copy
IItemStack.getCapabilityWithContext<T : Object, C : Object>(cap as ItemCapability<T,C>, context as @org.openzen.zencode.java.ZenCodeType.Nullable C) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
cap
Type
ItemCapability<T,C>
Parameter
context
Type
@org.openzen.zencode.java.ZenCodeType.Nullable C
Parameter
T
Type
Object
Parameter
C
Type
Object