ToolRule
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.
Description
Represents a rule that defines how a tool interacts with specific blocks. Rules can override mining speed, determine if the tool is correct for harvesting drops, and more.Members
Getter
Retrieves the list of blocks that this rule applies to.
Return Type:
List<Block>
Getter
Retrieves whether the tool is correct for harvesting drops according to this rule. Throws an exception if the rule does not define this value.
IllegalStateException If the rule does not have a value for 'correctToolForDrops'.
IllegalStateException If the rule does not have a value for 'correctToolForDrops'.
Return Type:
bool
Getter
Checks if this rule defines whether the tool is correct for harvesting drops.
Return Type:
bool
static minesAndDrops(tag as KnownTag<Block>, speed as float) as Rule
Creates a new rule that allows mining and harvesting drops for blocks matching the specified tag.
Returns: A new Tool.Rule instance.
Parameters:
Return Type:
ToolRule
static minesAndDrops(blocks as List<Block>, speed as float) as Rule
static overrideSpeed(blocks as List<Block>, speed as float) as Rule
static overrideSpeed(tag as KnownTag<Block>, speed as float) as Rule
Creates a new rule that overrides the mining speed for blocks matching the specified tag.
Returns: A new Tool.Rule instance.
Parameters:
Return Type:
ToolRule
Getter
Retrieves the mining speed override defined by this rule, if any.
Return Type:
Float