Package net.minecraft.item
Class ItemUsageContext
java.lang.Object
net.minecraft.item.ItemUsageContext
- Direct Known Subclasses:
ItemPlacementContext
public class ItemUsageContext extends Object
-
Field Summary
Fields Modifier and Type Field Description private Hand
hand
private BlockHitResult
hit
private PlayerEntity
player
private ItemStack
stack
private World
world
-
Constructor Summary
Constructors Modifier Constructor Description ItemUsageContext(PlayerEntity player, Hand hand, BlockHitResult hit)
protected
ItemUsageContext(World world, PlayerEntity player, Hand hand, ItemStack stack, BlockHitResult hit)
-
Method Summary
Modifier and Type Method Description BlockPos
getBlockPos()
Hand
getHand()
Vec3d
getHitPos()
protected BlockHitResult
getHitResult()
PlayerEntity
getPlayer()
Direction
getPlayerFacing()
float
getPlayerYaw()
Direction
getSide()
ItemStack
getStack()
World
getWorld()
boolean
hitsInsideBlock()
boolean
shouldCancelInteraction()
-
Field Details
-
player
-
hand
-
hit
-
world
-
stack
-
-
Constructor Details
-
ItemUsageContext
-
ItemUsageContext
protected ItemUsageContext(World world, @Nullable PlayerEntity player, Hand hand, ItemStack stack, BlockHitResult hit)
-
-
Method Details
-
getHitResult
-
getBlockPos
-
getSide
-
getHitPos
-
hitsInsideBlock
public boolean hitsInsideBlock() -
getStack
-
getPlayer
-
getHand
-
getWorld
-
getPlayerFacing
-
shouldCancelInteraction
public boolean shouldCancelInteraction() -
getPlayerYaw
public float getPlayerYaw()
-