Skip to content

HungerChange ​

com.jsmacrosce.jsmacros.client.api.event.impl.player.EventHungerChange

Since1.2.7Not cancellable

Fires before the local player's food level is assigned, when setFoodLevel receives a value different from the current one. The event reports the incoming value.

Constructors ​

new EventHungerChange ​

new EventHungerChange(int foodLevel)#
Initializes this event with the supplied food-level value, stored unchanged in foodLevel.

Parameters:

  • foodLevel: supplied food-level value

Fields ​

foodLevel ​

foodLevel: intread-only#
The incoming food-level value, conventionally 0 for an empty hunger bar through 20 for a full one. This is the value passed to setFoodLevel; the method does not clamp it.

Methods ​

toString ​

toString(): String#
Returns an event-name-prefixed diagnostic string in the form %s:{"foodLevel": %d}.
Returns: diagnostic string containing the event name and stored food-level value