public final class ToolManager extends Object
DynamicAttributeTool
to change the mining level or speed of your tool depending on the ItemStack
.Modifier and Type | Method and Description |
---|---|
static float |
handleBreakingSpeed(net.minecraft.block.BlockState state,
net.minecraft.item.ItemStack stack,
@Nullable net.minecraft.entity.LivingEntity user)
Handles the breaking speed breaking a block.
|
static float |
handleBreakingSpeedIgnoresVanilla(net.minecraft.block.BlockState state,
net.minecraft.item.ItemStack stack,
@Nullable net.minecraft.entity.LivingEntity user)
Handles the breaking speed breaking a block, ignores vanilla tools on vanilla blocks.
|
static boolean |
handleIsEffectiveOn(net.minecraft.block.BlockState state,
net.minecraft.item.ItemStack stack,
@Nullable net.minecraft.entity.LivingEntity user)
Handles if the tool is effective on a block.
|
static boolean |
handleIsEffectiveOnIgnoresVanilla(net.minecraft.block.BlockState state,
net.minecraft.item.ItemStack stack,
@Nullable net.minecraft.entity.LivingEntity user)
Handles if the tool is effective on a block, ignores vanilla tools on vanilla blocks.
|
static boolean |
handleIsEffectiveOnIgnoresVanilla(net.minecraft.block.BlockState state,
net.minecraft.item.ItemStack stack,
@Nullable net.minecraft.entity.LivingEntity user,
boolean vanillaResult)
Handles if the tool is effective on a block, ignores vanilla tools on vanilla blocks.
|
public static boolean handleIsEffectiveOn(net.minecraft.block.BlockState state, net.minecraft.item.ItemStack stack, @Nullable @Nullable net.minecraft.entity.LivingEntity user)
state
- the block state to breakstack
- the item stack involved with breaking the blockuser
- the user involved in breaking the block, null if not applicable.public static boolean handleIsEffectiveOnIgnoresVanilla(net.minecraft.block.BlockState state, net.minecraft.item.ItemStack stack, @Nullable @Nullable net.minecraft.entity.LivingEntity user, boolean vanillaResult)
state
- the block state to breakstack
- the item stack involved with breaking the blockuser
- the user involved in breaking the block, null if not applicable.vanillaResult
- whether the tool is considered effective by vanillapublic static boolean handleIsEffectiveOnIgnoresVanilla(net.minecraft.block.BlockState state, net.minecraft.item.ItemStack stack, @Nullable @Nullable net.minecraft.entity.LivingEntity user)
state
- the block state to breakstack
- the item stack involved with breaking the blockuser
- the user involved in breaking the block, null if not applicable.public static float handleBreakingSpeed(net.minecraft.block.BlockState state, net.minecraft.item.ItemStack stack, @Nullable @Nullable net.minecraft.entity.LivingEntity user)
state
- the block state to breakstack
- the item stack involved with breaking the blockuser
- the user involved in breaking the block, null if not applicable.public static float handleBreakingSpeedIgnoresVanilla(net.minecraft.block.BlockState state, net.minecraft.item.ItemStack stack, @Nullable @Nullable net.minecraft.entity.LivingEntity user)
state
- the block state to breakstack
- the item stack involved with breaking the blockuser
- the user involved in breaking the block, null if not applicable.