public class PlayerInteractEvent extends PlayerEvent
ForgeEventFactory#onPlayerInteract(EntityPlayer, Action, BlockPos, EnumFacing)
.
action
contains the Action the player performed durin this interaction. pos
contains the coordinate of where this event occurred.face
contains the face of the block that was interacted with. May be null if unknown. world
contains the world in which this event is occurring. Cancelable
.HasResult
MinecraftForge#EVENT_BUS
.Modifier and Type | Class and Description |
---|---|
static class |
PlayerInteractEvent.Action |
PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing
Event.HasResult, Event.Result
Modifier and Type | Field and Description |
---|---|
PlayerInteractEvent.Action |
action |
EnumFacing |
face |
Vec3 |
localPos |
BlockPos |
pos |
Event.Result |
useBlock |
Event.Result |
useItem |
World |
world |
entityPlayer
entityLiving
entity
Constructor and Description |
---|
PlayerInteractEvent(EntityPlayer player,
PlayerInteractEvent.Action action,
BlockPos pos,
EnumFacing face,
World world)
Deprecated.
|
PlayerInteractEvent(EntityPlayer player,
PlayerInteractEvent.Action action,
BlockPos pos,
EnumFacing face,
World world,
Vec3 localPos) |
Modifier and Type | Method and Description |
---|---|
void |
setCanceled(boolean cancel)
Sets the state of this event, not all events are cancelable, and any attempt to
cancel a event that can't be will result in a IllegalArgumentException.
|
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setPhase, setResult, setup
public final PlayerInteractEvent.Action action
public final World world
public final BlockPos pos
public final EnumFacing face
public final Vec3 localPos
public Event.Result useBlock
public Event.Result useItem
@Deprecated public PlayerInteractEvent(EntityPlayer player, PlayerInteractEvent.Action action, BlockPos pos, EnumFacing face, World world)
public PlayerInteractEvent(EntityPlayer player, PlayerInteractEvent.Action action, BlockPos pos, EnumFacing face, World world, Vec3 localPos)
public void setCanceled(boolean cancel)
Event
setCanceled
in class Event
cancel
- The new canceled value