modifyUseDuration

open override fun modifyUseDuration(entity: LivingEntity, itemStack: ItemStack, duration: Int): Int

Modifies the server-side use duration of itemStack with this behavior for entity. The initial value of duration may stem from baseDataComponents. If the use duration is <= 0, the item cannot be used (no right click and hold action).

Note that the client may predict a different use duration, which this method does not handle.