Tool

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

Members

Getter
script.zs
// Tool.damagePerBlock as int
myTool.damagePerBlock

Return Type: int

Getter
script.zs
// Tool.defaultMiningSpeed as float
myTool.defaultMiningSpeed

Return Type: float

getMiningSpeed(state as BlockState) as float
script.zs
// Tool.getMiningSpeed(state as BlockState) as float;
myTool.getMiningSpeed(myBlockState);

Parameters:

state Type: BlockState

Return Type: float

isCorrectForDrops(state as BlockState) as bool
script.zs
// Tool.isCorrectForDrops(state as BlockState) as bool;
myTool.isCorrectForDrops(myBlockState);

Parameters:

state Type: BlockState

Return Type: bool

static of(rules as List<Rule>, defaultMiningSpeed as float, damagePerBlock as int) as Tool
script.zs
// Tool.of(rules as List<ToolRule>, defaultMiningSpeed as float, damagePerBlock as int) as Tool;
Tool.of(myList, myFloat, myInt);

Parameters:

rules Type: List<ToolRule>
defaultMiningSpeed Type: float
damagePerBlock Type: int

Return Type: Tool

Getter
script.zs
// Tool.rules as List<ToolRule>
myTool.rules

Return Type: List<ToolRule>