Skip to content

AirChange ​

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

Since1.2.7Not cancellable

Fires before the local player's air supply is set to a value divisible by 20; it does not report other values.

js
JsMacros.on("AirChange", JavaWrapper.methodToJava(function (event) {
  if (0 >= event.air) {
    Chat.log("Out of air");  
  } else if (60 >= event.air) {
    Chat.log(`Only ${event.air} air left, about ${event.air / 20} seconds`);  
  }
}))

Constructors ​

new EventAirChange ​

new EventAirChange(int air)#
Initializes this event with the client core and the supplied air-supply value, stored unchanged.

Parameters:

  • air: supplied air-supply value

Fields ​

air ​

air: intread-only#
the air supply value being set on the local player.

Methods ​

toString ​

toString(): String#
Formats the event name and stored air value as a diagnostic string, not JSON.
Returns: the event name followed by the stored air value in decimal form