public class PlayerInteractEvent extends PlayerEvent
ForgeEventFactory#onPlayerInteract(EntityPlayer, Action, int, int, int, int).
action contains the Action the player performed durin this interaction. x contains the x-coordinate of where this event occurred. y contains the y-coordinate of where this event occurred. z contains the z-coordinate of where this event occurred. face contains the face of the block that was interacted with. world contains the world in which this event is occurring. Cancelable.HasResultMinecraftForge#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.StopTrackingLivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEventEntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructingEvent.HasResult, Event.Result| Modifier and Type | Field and Description |
|---|---|
PlayerInteractEvent.Action |
action |
int |
face |
Event.Result |
useBlock |
Event.Result |
useItem |
World |
world |
int |
x |
int |
y |
int |
z |
entityPlayerentityLivingentity| Constructor and Description |
|---|
PlayerInteractEvent(EntityPlayer player,
PlayerInteractEvent.Action action,
int x,
int y,
int z,
int face)
Deprecated.
|
PlayerInteractEvent(EntityPlayer player,
PlayerInteractEvent.Action action,
int x,
int y,
int z,
int face,
World world) |
| 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, setuppublic final PlayerInteractEvent.Action action
public final int x
public final int y
public final int z
public final int face
public final World world
public Event.Result useBlock
public Event.Result useItem
@Deprecated public PlayerInteractEvent(EntityPlayer player, PlayerInteractEvent.Action action, int x, int y, int z, int face)
public PlayerInteractEvent(EntityPlayer player, PlayerInteractEvent.Action action, int x, int y, int z, int face, World world)
public void setCanceled(boolean cancel)
EventsetCanceled in class Eventcancel - The new canceled value