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.api.item.component.Tool;

Extending Record

Link to extending-record

Tool extends Record. That means all methods available in Record are also available in Tool

Name: of

Return Type: Tool

ZenScript
Copy
Tool.of(rules as stdlib.List<ToolRule>, defaultMiningSpeed as float, damagePerBlock as int) as Tool
ParameterType
Parameter
rules
Type
stdlib.List<ToolRule>
Parameter
defaultMiningSpeed
Type
float
Parameter
damagePerBlock
Type
int

Name: getMiningSpeed

Return Type: float

ZenScript
Copy
Tool.getMiningSpeed(state as BlockState) as float
ParameterType
Parameter
state
Type
BlockState

Link to isCorrectForDrops

Name: isCorrectForDrops

Return Type: boolean

ZenScript
Copy
Tool.isCorrectForDrops(state as BlockState) as boolean
ParameterType
Parameter
state
Type
BlockState
NameTypeHas GetterHas Setter
Name
damagePerBlock
Type
int
Has Getter
true
Has Setter
false
Name
defaultMiningSpeed
Type
float
Has Getter
true
Has Setter
false
Name
rules
Type
stdlib.List<ToolRule>
Has Getter
true
Has Setter
false