UseOnContext
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
import crafttweaker.api.item.UseOnContext;
Methods
Return Type: Vec3
// UseOnContext.getClickLocation() as Vec3
myUseOnContext.getClickLocation();
Return Type: Direction
// UseOnContext.getClickedFace() as Direction
myUseOnContext.getClickedFace();
Return Type: BlockPos
// UseOnContext.getClickedPos() as BlockPos
myUseOnContext.getClickedPos();
Return Type: InteractionHand
// UseOnContext.getHand() as InteractionHand
myUseOnContext.getHand();
Return Type: Direction
// UseOnContext.getHorizontalDirection() as Direction
myUseOnContext.getHorizontalDirection();
Return Type: ItemStack
// UseOnContext.getItemInHand() as ItemStack
myUseOnContext.getItemInHand();
Return Type: Level
// UseOnContext.getLevel() as Level
myUseOnContext.getLevel();
Return Type: Player?
// UseOnContext.getPlayer() as Player?
myUseOnContext.getPlayer();
Return Type: float
// UseOnContext.getRotation() as float
myUseOnContext.getRotation();
Return Type: boolean
// UseOnContext.isInside() as boolean
myUseOnContext.isInside();
Return Type: boolean
// UseOnContext.isSecondaryUseActive() as boolean
myUseOnContext.isSecondaryUseActive();
Properties
Name | Type | Has Getter | Has Setter |
---|---|---|---|
Name clickLocation | Type Vec3 | Has Getter true | Has Setter false |
Name clickedFace | Type Direction | Has Getter true | Has Setter false |
Name clickedPos | Type BlockPos | Has Getter true | Has Setter false |
Name hand | Type InteractionHand | Has Getter true | Has Setter false |
Name horizontalDirection | Type Direction | Has Getter true | Has Setter false |
Name isInside | Type boolean | Has Getter true | Has Setter false |
Name isSecondaryUseActive | Type boolean | Has Getter true | Has Setter false |
Name itemInHand | Type ItemStack | Has Getter true | Has Setter false |
Name level | Type Level | Has Getter true | Has Setter false |
Name player | Type Player? | Has Getter true | Has Setter false |
Name rotation | Type float | Has Getter true | Has Setter false |