Package net.minecraft.item
Class ItemUseContext
- java.lang.Object
-
- net.minecraft.item.ItemUseContext
-
- Direct Known Subclasses:
BlockItemUseContext
public class ItemUseContext extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private Handhandprivate BlockRayTraceResulthitResultprivate ItemStackitemStackprivate Worldlevelprivate PlayerEntityplayer
-
Constructor Summary
Constructors Constructor Description ItemUseContext(PlayerEntity p_i50033_1_, Hand p_i50033_2_, BlockRayTraceResult p_i50033_3_)ItemUseContext(World p_i50034_1_, PlayerEntity p_i50034_2_, Hand p_i50034_3_, ItemStack p_i50034_4_, BlockRayTraceResult p_i50034_5_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectiongetClickedFace()BlockPosgetClickedPos()Vector3dgetClickLocation()HandgetHand()protected BlockRayTraceResultgetHitResult()DirectiongetHorizontalDirection()ItemStackgetItemInHand()WorldgetLevel()PlayerEntitygetPlayer()floatgetRotation()booleanisInside()booleanisSecondaryUseActive()
-
-
-
Field Detail
-
player
@Nullable private final PlayerEntity player
-
hand
private final Hand hand
-
hitResult
private final BlockRayTraceResult hitResult
-
level
private final World level
-
itemStack
private final ItemStack itemStack
-
-
Constructor Detail
-
ItemUseContext
public ItemUseContext(PlayerEntity p_i50033_1_, Hand p_i50033_2_, BlockRayTraceResult p_i50033_3_)
-
ItemUseContext
public ItemUseContext(World p_i50034_1_, @Nullable PlayerEntity p_i50034_2_, Hand p_i50034_3_, ItemStack p_i50034_4_, BlockRayTraceResult p_i50034_5_)
-
-
Method Detail
-
getHitResult
protected final BlockRayTraceResult getHitResult()
-
getClickedPos
public BlockPos getClickedPos()
-
getClickedFace
public Direction getClickedFace()
-
getClickLocation
public Vector3d getClickLocation()
-
isInside
public boolean isInside()
-
getItemInHand
public ItemStack getItemInHand()
-
getPlayer
@Nullable public PlayerEntity getPlayer()
-
getHand
public Hand getHand()
-
getLevel
public World getLevel()
-
getHorizontalDirection
public Direction getHorizontalDirection()
-
isSecondaryUseActive
public boolean isSecondaryUseActive()
-
getRotation
public float getRotation()
-
-