public class FoodLevelChangeEvent extends EntityEvent implements Cancellable
Event.Resultentity| Constructor and Description | 
|---|
FoodLevelChangeEvent(@NotNull HumanEntity what,
                    int level)  | 
FoodLevelChangeEvent(@NotNull HumanEntity what,
                    int level,
                    @Nullable ItemStack item)  | 
| Modifier and Type | Method and Description | 
|---|---|
@NotNull HumanEntity | 
getEntity()
Returns the Entity involved in this event 
 | 
int | 
getFoodLevel()
Gets the resultant food level that the entity involved in this event
 should be set to. 
 | 
static @NotNull HandlerList | 
getHandlerList()  | 
@NotNull HandlerList | 
getHandlers()  | 
@Nullable ItemStack | 
getItem()
Gets the item that triggered this event, if any. 
 | 
boolean | 
isCancelled()
Gets the cancellation state of this event. 
 | 
void | 
setCancelled(boolean cancel)
Sets the cancellation state of this event. 
 | 
void | 
setFoodLevel(int level)
Sets the resultant food level that the entity involved in this event
 should be set to 
 | 
getEntityTypegetEventName, isAsynchronouspublic FoodLevelChangeEvent(@NotNull
                            @NotNull HumanEntity what,
                            int level)
public FoodLevelChangeEvent(@NotNull
                            @NotNull HumanEntity what,
                            int level,
                            @Nullable
                            @Nullable ItemStack item)
@NotNull public @NotNull HumanEntity getEntity()
EntityEventgetEntity in class EntityEvent@Nullable public @Nullable ItemStack getItem()
public int getFoodLevel()
Where 20 is a full food bar and 0 is an empty one.
public void setFoodLevel(int level)
level - the resultant food level that the entity involved in this
     event should be set topublic boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - true if you wish to cancel this event@NotNull public @NotNull HandlerList getHandlers()
getHandlers in class Event@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.