Interface ToolComponent.ToolRule
- All Superinterfaces:
- ConfigurationSerializable
- Enclosing interface:
- ToolComponent
A rule governing use of this tool and overriding attributes per-block.
- 
Method SummaryModifier and TypeMethodDescriptionGet a collection of the block types to which this tool rule applies.getSpeed()Get the mining speed of this rule.Get whether or not this rule is considered the optimal tool for the blocks listed by this rule and will drop items.voidsetBlocks(@NotNull Collection<Material> blocks) Set the block types to which this rule applies.voidSet the block type to which this rule applies.voidSet the block types (represented as a blockTag) to which this rule applies.voidsetCorrectForDrops(@Nullable Boolean correct) Set whether or not this rule is considered the optimal tool for the blocks listed by this rule and will drop items.voidSet the mining speed of this rule.Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializableserialize
- 
Method Details- 
getBlocksGet a collection of the block types to which this tool rule applies.- Returns:
- the blocks
 
- 
setBlocksSet the block type to which this rule applies.- Parameters:
- block- the block type
 
- 
setBlocksSet the block types to which this rule applies.- Parameters:
- blocks- the block types
 
- 
setBlocksSet the block types (represented as a blockTag) to which this rule applies.- Parameters:
- tag- the block tag
- Throws:
- IllegalArgumentException- if the passed- tagis not a block tag
 
- 
getSpeedGet the mining speed of this rule. If non-null, this speed value is used in lieu of the default speed value of the tool. 1.0 is standard mining speed.- Returns:
- the mining speed, or null if the default speed is used
 
- 
setSpeedSet the mining speed of this rule. 1.0 is standard mining speed.- Parameters:
- speed- the mining speed, or null to use the default speed
 
- 
isCorrectForDropsGet whether or not this rule is considered the optimal tool for the blocks listed by this rule and will drop items. If non-null, this value is used in lieu of the default tool checking behavior defined by Minecraft.- Returns:
- true if correct for drops, false otherwise, or null to fallback to vanilla tool checking behavior
 
- 
setCorrectForDropsSet whether or not this rule is considered the optimal tool for the blocks listed by this rule and will drop items.- Parameters:
- correct- whether or not this rule is correct for drops, or null to fallback to vanilla tool checking behavior
 
 
-