IItemUpdate
Link to iitemupdate
The IItemUpdateFunction can be added to an Item to allow code to be executed whenever the item updates.
导入相关包
Link to 导入相关包
If you ever feel the need to import this function's class, here you go:
ZenScript Copyimport mods.contenttweaker.IItemUpdate;
We have a void function that takes the following parameters (in order)
- An IMutableItemStack representing the item stack itself.
- An IWorld object representing the world the action takes place in.
- An IEntity object downcast as far as possible, so you can instanceOf up until ICTPlayer.
- An int representing the slot the item currently is in
- A boolean stating whether or not the item is currently selected.
ZenScript Copyitem.onItemUpdate = function(itemStack, world, owner, slot, isSelected) {
//CODE GOES HERE!!
return;
}