Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.entity.FoodLevelChangeEvent Class Reference
Inheritance diagram for org.bukkit.event.entity.FoodLevelChangeEvent:
org.bukkit.event.entity.EntityEvent org.bukkit.event.Cancellable org.bukkit.event.Event

Public Member Functions

 FoodLevelChangeEvent (final HumanEntity what, final int level)
 
HumanEntity getEntity ()
 
int getFoodLevel ()
 
void setFoodLevel (int level)
 
boolean isCancelled ()
 
void setCancelled (boolean cancel)
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.entity.EntityEvent
 EntityEvent (final Entity what)
 
Entity getEntity ()
 
EntityType getEntityType ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 
 Event (boolean isAsync)
 
String getEventName ()
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 

Static Public Member Functions

static HandlerList getHandlerList ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.entity.EntityEvent
Entity entity
 

Detailed Description

Called when a human entity's food level changes

Definition at line 10 of file FoodLevelChangeEvent.java.

Member Function Documentation

int org.bukkit.event.entity.FoodLevelChangeEvent.getFoodLevel ( )

Gets the resultant food level that the entity involved in this event should be set to.

Where 20 is a full food bar and 0 is an empty one.

Returns
The resultant food level

Definition at line 33 of file FoodLevelChangeEvent.java.

33  {
34  return level;
35  }
boolean org.bukkit.event.entity.FoodLevelChangeEvent.isCancelled ( )

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

Implements org.bukkit.event.Cancellable.

Definition at line 51 of file FoodLevelChangeEvent.java.

51  {
52  return cancel;
53  }
void org.bukkit.event.entity.FoodLevelChangeEvent.setCancelled ( boolean  cancel)

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

Implements org.bukkit.event.Cancellable.

Definition at line 55 of file FoodLevelChangeEvent.java.

55  {
56  this.cancel = cancel;
57  }
void org.bukkit.event.entity.FoodLevelChangeEvent.setFoodLevel ( int  level)

Sets the resultant food level that the entity involved in this event should be set to

Parameters
levelthe resultant food level that the entity involved in this event should be set to

Definition at line 44 of file FoodLevelChangeEvent.java.

44  {
45  if (level > 20) level = 20;
46  else if (level < 0) level = 0;
47 
48  this.level = level;
49  }

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