Skip to content

ToolComponentHelper.Rule ​

com.jsmacrosce.jsmacros.client.api.helper.inventory.ToolComponentHelper.Rule

Since2.3.0

Describes one mining rule: the blocks it applies to and the settings it overrides.

js
const tool = Player.getPlayer()?.getMainHand().getComponents().getTool();  
if (tool != null) {
 for (const rule of tool.getRules()) {
   const tag = rule.getBlockTagId();  
   if (tag !== null) Chat.log(`#${tag}: ${rule.getMiningSpeed()}`);  
 }
}

Nested type declared in ToolComponentHelper.

Methods ​

getBlockIds ​

getBlockIds(): List<String>#
Lists the blocks in this rule. Tags whose members are not loaded have an empty list.
Returns: the block IDs

getBlockTagId ​

getBlockTagId(): String#
Returns: the block tag's ID without the leading "#", or null for a list of blocks

getCorrectForDrops ​

getCorrectForDrops(): Boolean#
Returns: whether the rule allows drops, or null if it leaves this unspecified

getMiningSpeed ​

getMiningSpeed(): Float#
Returns: the speed set by this rule, or null if it leaves the speed unspecified