Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.inventory.InventoryInteractEvent Class Referenceabstract
Inheritance diagram for org.bukkit.event.inventory.InventoryInteractEvent:
org.bukkit.event.inventory.InventoryEvent org.bukkit.event.Cancellable org.bukkit.event.Event org.bukkit.event.inventory.InventoryClickEvent org.bukkit.event.inventory.InventoryDragEvent org.bukkit.event.inventory.CraftItemEvent org.bukkit.event.inventory.InventoryCreativeEvent

Public Member Functions

 InventoryInteractEvent (InventoryView transaction)
 
HumanEntity getWhoClicked ()
 
void setResult (Result newResult)
 
Result getResult ()
 
boolean isCancelled ()
 
void setCancelled (boolean toCancel)
 
- Public Member Functions inherited from org.bukkit.event.inventory.InventoryEvent
 InventoryEvent (InventoryView transaction)
 
Inventory getInventory ()
 
List< HumanEntitygetViewers ()
 
InventoryView getView ()
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 
 Event (boolean isAsync)
 
String getEventName ()
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 

Additional Inherited Members

- Static Public Member Functions inherited from org.bukkit.event.inventory.InventoryEvent
static HandlerList getHandlerList ()
 
- Protected Attributes inherited from org.bukkit.event.inventory.InventoryEvent
InventoryView transaction
 

Detailed Description

An abstract base class for events that describe an interaction between a HumanEntity and the contents of an Inventory.

Definition at line 13 of file InventoryInteractEvent.java.

Member Function Documentation

Result org.bukkit.event.inventory.InventoryInteractEvent.getResult ( )

Gets the Result of this event. The Result describes the behavior that will be applied to the inventory in relation to this event.

Returns
the Result of this event.

Definition at line 47 of file InventoryInteractEvent.java.

Referenced by org.bukkit.event.inventory.InventoryInteractEvent.isCancelled().

47  {
48  return result;
49  }
HumanEntity org.bukkit.event.inventory.InventoryInteractEvent.getWhoClicked ( )

Gets the player who performed the click.

Returns
The clicking player.

Definition at line 25 of file InventoryInteractEvent.java.

References org.bukkit.inventory.InventoryView.getPlayer(), and org.bukkit.event.inventory.InventoryEvent.getView().

25  {
26  return getView().getPlayer();
27  }
abstract HumanEntity getPlayer()
boolean org.bukkit.event.inventory.InventoryInteractEvent.isCancelled ( )

Gets whether or not this event is cancelled. This is based off of the Result value returned by getResult(). Result.ALLOW and Result.DEFAULT will result in a returned value of false, but Result.DENY will result in a returned value of true.

Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Returns
true if this event is cancelled

Returns
whether the event is cancelled

Implements org.bukkit.event.Cancellable.

Definition at line 61 of file InventoryInteractEvent.java.

References org.bukkit.event.Event.Result.DENY, and org.bukkit.event.inventory.InventoryInteractEvent.getResult().

void org.bukkit.event.inventory.InventoryInteractEvent.setCancelled ( boolean  toCancel)

Proxy method to setResult(Event.Result) for the Cancellable interface. setResult(Event.Result) is preferred, as it allows you to specify the Result beyond Result.DENY and Result.ALLOW.

Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Parameters
canceltrue if you wish to cancel this event

Parameters
toCancelresult becomes DENY if true, ALLOW if false

Implements org.bukkit.event.Cancellable.

Definition at line 74 of file InventoryInteractEvent.java.

References org.bukkit.event.Event.Result.ALLOW, org.bukkit.event.Event.Result.DENY, and org.bukkit.event.inventory.InventoryInteractEvent.setResult().

74  {
75  setResult(toCancel ? Result.DENY : Result.ALLOW);
76  }
void org.bukkit.event.inventory.InventoryInteractEvent.setResult ( Result  newResult)

Sets the result of this event. This will change whether or not this event is considered cancelled.

See also
isCancelled()
Parameters
newResultthe new Result for this event

Definition at line 36 of file InventoryInteractEvent.java.

Referenced by org.bukkit.event.inventory.InventoryInteractEvent.setCancelled().

36  {
37  result = newResult;
38  }

The documentation for this class was generated from the following file: