DynamicAttributeTool

public interface DynamicAttributeTool

Interface for adding various tool attributes to items.

Functions in this interface will provide user context if it is available. These context parameters are provided on a best-effort basis, and implementations should not fail hard if they are absent.

Functions

getDynamicModifiers
Link copied to clipboard
Multimap<EntityAttribute, EntityAttributeModifiergetDynamicModifiers(EquipmentSlot slot, ItemStack stack, @Nullable() LivingEntity user)
Add modifiers for any net.minecraft.entity.attribute.EntityAttributes your item should give when equipped, based on the stack.
getMiningLevel
Link copied to clipboard
int getMiningLevel(ItemStack stack, @Nullable() LivingEntity user)
Determines the mining level of the passed stack, which is used for calculating what blocks this tool is allowed to break.
int getMiningLevel(Tag<Item> tag, BlockState state, ItemStack stack, @Nullable() LivingEntity user)
Determines the mining level of the passed stack, which is used for calculating what blocks this tool is allowed to break.
getMiningSpeedMultiplier
Link copied to clipboard
float getMiningSpeedMultiplier(ItemStack stack, @Nullable() LivingEntity user)
Determines the mining speed multiplier of the passed stack, which is one factor in overall mining speed.
float getMiningSpeedMultiplier(Tag<Item> tag, BlockState state, ItemStack stack, @Nullable() LivingEntity user)
Determines the mining speed multiplier of the passed stack, which is one factor in overall mining speed.
postProcessMiningSpeed
Link copied to clipboard
float postProcessMiningSpeed(Tag<Item> tag, BlockState state, ItemStack stack, @Nullable() LivingEntity user, float currentSpeed, boolean isEffective)
Post process the mining speed, this takes place after the mining speed has been calculated.

Inheritors

MixinToolItem
Link copied to clipboard

Sources

jvm source
Link copied to clipboard