IItemUse Function
An itemUseFunction is called whenever the associated item is used on a block.
Importing the package
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.IItemUse;
Parameters
The IItemUse function is a function with the following parameters (In this order):
- ICTPlayer player → The player doing the right-click
- IWorld world → The world the player is in
- IBlockPos pos → The Position of the block the item is used on
- Hand hand → The used Hand (main or off)
- Facing facing → The side of the block the item is used on
- Position3f blockHit → The block’s relative X,Y and Z coordinate → All three are between 0 and 1
The function needs to return an ActionResult object.