CustomDamageHandler

public interface CustomDamageHandler

Allows an item to run custom logic when damage is called. This is useful for items that, for example, may drain durability from some other source before damaging the stack itself.

Custom damage handlers can be set with customDamage.

Functions

damage
Link copied to clipboard
abstract int damage(ItemStack stack, int amount, LivingEntity entity, Consumer<LivingEntity> breakCallback)
Called to apply damage to the given stack.This can be used to e.g.

Sources

jvm source
Link copied to clipboard