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 Handhandprivate BlockHitResulthitprivate PlayerEntityplayerprivate ItemStackstackprivate Worldworld -
Constructor Summary
Constructors Modifier Constructor Description ItemUsageContext(PlayerEntity player, Hand hand, BlockHitResult hit)protectedItemUsageContext(World world, PlayerEntity player, Hand hand, ItemStack stack, BlockHitResult hit) -
Method Summary
Modifier and Type Method Description BlockPosgetBlockPos()HandgetHand()Vec3dgetHitPos()protected BlockHitResultgetHitResult()PlayerEntitygetPlayer()DirectiongetPlayerFacing()floatgetPlayerYaw()DirectiongetSide()ItemStackgetStack()WorldgetWorld()booleanhitsInsideBlock()booleanshouldCancelInteraction()
-
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()
-