IItemUseFinish
Link to iitemusefinish
The IItemUseFinish function can be added to an item and will be triggered only when a user finishes using the item (e.g. finishes eating).
导入相关包
Link to 导入相关包
It might be required for you to import the package if you encounter any issues, so better be safe than sorry and add the import.
import mods.contenttweaker.IItemUseFinish;
Parameters
Link to parameters
The IItemRightClickFunction is a function with the following parameters:
- IMutableItemStack itemStack → The item that is used
- IWorld world → The world the player is in
- IEntityLivingBase entity → The entity using the item
The function needs to return an IItemStack.
ZenScript CopyzsItem.onItemUseFinish = function(stack, world, player) {
stack.damage(1, player);
return stack;
};