# AirChange

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

**Since:** 1.2.7

**Cancellable:** No. Calling `event.cancel()` throws `UnsupportedOperationException`.

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 {#com.jsmacrosce.jsmacros.client.api.event.impl.player.EventAirChange_constructor-int-}

```js
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 {#com.jsmacrosce.jsmacros.client.api.event.impl.player.EventAirChange_air}

```js
air: int
```

the air supply value being set on the local player.

## Methods

### toString {#com.jsmacrosce.jsmacros.client.api.event.impl.player.EventAirChange_toString-}

```js
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
