public class ItemUsageContext extends Object
Modifier and Type | Field and Description |
---|---|
private Hand |
hand |
private BlockHitResult |
hit |
private PlayerEntity |
player |
private ItemStack |
stack |
private World |
world |
Modifier | Constructor and Description |
---|---|
|
ItemUsageContext(PlayerEntity player,
Hand hand,
BlockHitResult hit) |
protected |
ItemUsageContext(World world,
PlayerEntity player,
Hand hand,
ItemStack stack,
BlockHitResult hit) |
Modifier and Type | Method and 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() |
@Nullable private final PlayerEntity player
private final Hand hand
private final BlockHitResult hit
private final World world
private final ItemStack stack
public ItemUsageContext(PlayerEntity player, Hand hand, BlockHitResult hit)
protected ItemUsageContext(World world, @Nullable PlayerEntity player, Hand hand, ItemStack stack, BlockHitResult hit)
protected final BlockHitResult getHitResult()
public BlockPos getBlockPos()
public Direction getSide()
public Vec3d getHitPos()
public boolean hitsInsideBlock()
public ItemStack getStack()
@Nullable public PlayerEntity getPlayer()
public Hand getHand()
public World getWorld()
public Direction getPlayerFacing()
public boolean shouldCancelInteraction()
public float getPlayerYaw()