# FallFlying

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

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

Fires when the local player's polled fall-flying state differs from the previous sample.  
The state is checked once per client tick while a player is present. The previous sample is
retained while no player is present, including across disconnects, so a later event may compare
different player instances.  
```js
JsMacros.on("FallFlying", JavaWrapper.methodToJava(function (event) {
  if (event.state) {
    Chat.log("Elytra flight started");  
  } else {
    Chat.log("Elytra flight ended");  
  }
}))
```

## Constructors

### new EventFallFlying {#com.jsmacrosce.jsmacros.client.api.event.impl.player.EventFallFlying_constructor-boolean-}

```js
new EventFallFlying(boolean state)
```

Initializes the event with the supplied fall-flying state.

**Parameters:**
- `state`: the supplied fall-flying state

## Fields

### state {#com.jsmacrosce.jsmacros.client.api.event.impl.player.EventFallFlying_state}

```js
state: boolean
```

The newly sampled fall-flying state: `true` if fall-flying, `false` otherwise.

## Methods

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

```js
toString(): String
```

Returns an event-name and stored-state diagnostic in the format `%s:{"state": %s}`,  
with the payload rendered as `true` or `false`; this is not JSON.

**Returns:** the event name and stored state in the diagnostic format
