ToolManager

public final class ToolManager

API facing part to register tool handlers and get information about how tools are handled. Implement DynamicAttributeTool to change the mining level or speed of your tool depending on the ItemStack.

Functions

handleBreakingSpeed
Link copied to clipboard
static float handleBreakingSpeed(BlockState state, ItemStack stack, @Nullable() LivingEntity user)
Handles the breaking speed breaking a block.
handleBreakingSpeedIgnoresVanilla
Link copied to clipboard
static float handleBreakingSpeedIgnoresVanilla(BlockState state, ItemStack stack, @Nullable() LivingEntity user)
Handles the breaking speed breaking a block, ignores vanilla tools on vanilla blocks.
handleIsEffectiveOn
Link copied to clipboard
static boolean handleIsEffectiveOn(BlockState state, ItemStack stack, @Nullable() LivingEntity user)
Handles if the tool is effective on a block.
handleIsEffectiveOnIgnoresVanilla
Link copied to clipboard
static boolean handleIsEffectiveOnIgnoresVanilla(BlockState state, ItemStack stack, @Nullable() LivingEntity user)
Handles if the tool is effective on a block, ignores vanilla tools on vanilla blocks.
static boolean handleIsEffectiveOnIgnoresVanilla(BlockState state, ItemStack stack, @Nullable() LivingEntity user, boolean vanillaResult)
Handles if the tool is effective on a block, ignores vanilla tools on vanilla blocks.

Sources

jvm source
Link copied to clipboard