public interface DynamicAttributeTool
Modifier and Type | Field and Description |
---|---|
static Multimap<net.minecraft.entity.attribute.EntityAttribute,net.minecraft.entity.attribute.EntityAttributeModifier> |
EMPTY |
Modifier and Type | Method and Description |
---|---|
default Multimap<net.minecraft.entity.attribute.EntityAttribute,net.minecraft.entity.attribute.EntityAttributeModifier> |
getDynamicModifiers(net.minecraft.entity.EquipmentSlot slot,
net.minecraft.item.ItemStack stack,
net.minecraft.entity.LivingEntity user)
Add modifiers for any
EntityAttributes your item should give when equipped, based on the stack. |
int |
getMiningLevel(net.minecraft.item.ItemStack stack,
net.minecraft.entity.LivingEntity user)
Determines the mining level of the passed stack, which is used for calculating what blocks this tool is allowed to break.
|
float |
getMiningSpeedMultiplier(net.minecraft.item.ItemStack stack,
net.minecraft.entity.LivingEntity user)
Determines the mining speed multiplier of the passed stack, which is one factor in overall mining speed.
|
static final Multimap<net.minecraft.entity.attribute.EntityAttribute,net.minecraft.entity.attribute.EntityAttributeModifier> EMPTY
int getMiningLevel(net.minecraft.item.ItemStack stack, net.minecraft.entity.LivingEntity user)
stack
- The stack to check on.user
- The current user of the tool, or null if there isn't any.float getMiningSpeedMultiplier(net.minecraft.item.ItemStack stack, net.minecraft.entity.LivingEntity user)
stack
- The stack to check on.user
- The current user of the tool, or null if there isn't any.default Multimap<net.minecraft.entity.attribute.EntityAttribute,net.minecraft.entity.attribute.EntityAttributeModifier> getDynamicModifiers(net.minecraft.entity.EquipmentSlot slot, net.minecraft.item.ItemStack stack, net.minecraft.entity.LivingEntity user)
EntityAttributes
your item should give when equipped, based on the stack.
Appends to either attribute modifier NBT or the result from Item.getModifiers(EquipmentSlot)
.
slot
- The equipment slot this item is equipped in.stack
- The stack that's equipped.user
- The current user of the tool, or none if there isn't anyEMPTY
.