UseOnContext
Link to useoncontext
Importing the class
Link to 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.
ZenScript Copyimport crafttweaker.api.item.UseOnContext;
Methods
Link to methods
Name: getClickLocation
Return Type: Vec3
ZenScript Copy// UseOnContext.getClickLocation() as Vec3
myUseOnContext.getClickLocation();
Name: getClickedFace
Return Type: Direction
ZenScript Copy// UseOnContext.getClickedFace() as Direction
myUseOnContext.getClickedFace();
Name: getClickedPos
Return Type: BlockPos
ZenScript Copy// UseOnContext.getClickedPos() as BlockPos
myUseOnContext.getClickedPos();
Name: getHand
Return Type: InteractionHand
ZenScript Copy// UseOnContext.getHand() as InteractionHand
myUseOnContext.getHand();
Name: getHorizontalDirection
Return Type: Direction
ZenScript Copy// UseOnContext.getHorizontalDirection() as Direction
myUseOnContext.getHorizontalDirection();
Name: getItemInHand
Return Type: ItemStack
ZenScript Copy// UseOnContext.getItemInHand() as ItemStack
myUseOnContext.getItemInHand();
Name: getLevel
Return Type: Level
ZenScript Copy// UseOnContext.getLevel() as Level
myUseOnContext.getLevel();
Name: getPlayer
Return Type: Player?
ZenScript Copy// UseOnContext.getPlayer() as Player?
myUseOnContext.getPlayer();
Name: getRotation
Return Type: float
ZenScript Copy// UseOnContext.getRotation() as float
myUseOnContext.getRotation();
Name: isInside
Return Type: boolean
ZenScript Copy// UseOnContext.isInside() as boolean
myUseOnContext.isInside();
Name: isSecondaryUseActive
Return Type: boolean
ZenScript Copy// UseOnContext.isSecondaryUseActive() as boolean
myUseOnContext.isSecondaryUseActive();
Properties
Link to properties
名称 | Type | Has Getter | Has Setter |
---|---|---|---|
名称 clickLocation | Type Vec3 | Has Getter true | Has Setter false |
名称 clickedFace | Type Direction | Has Getter true | Has Setter false |
名称 clickedPos | Type BlockPos | Has Getter true | Has Setter false |
名称 hand | Type InteractionHand | Has Getter true | Has Setter false |
名称 horizontalDirection | Type Direction | Has Getter true | Has Setter false |
名称 isInside | Type boolean型 | Has Getter true | Has Setter false |
名称 isSecondaryUseActive | Type boolean型 | Has Getter true | Has Setter false |
名称 itemInHand | Type ItemStack | Has Getter true | Has Setter false |
名称 level | Type Level | Has Getter true | Has Setter false |
名称 player | Type Player? | Has Getter true | Has Setter false |
名称 rotation | Type float | Has Getter true | Has Setter false |