How can i detect player flying start?

Hello
Is there any events that can detect when user makes double jump and starts flying?
Or detect player keys change (in this case IS_FLYING key)?

Yes. Take a look at this class

https://github.com/SpongePowered/SpongeAPI/blob/bleeding/src/main/java/org/spongepowered/api/event/data/ChangeDataHolderEvent.java

The event is ChangeDataHolderEvent.ValueChange
You then want to essentially filter the event so it will throw away the event if the data is not based on the flying key.

Please note the last time i used this event was in API 4 and it wasnt firing at the time. No idea is sponge has fixed that.

It has been implemented recently :wink:

Emm
I tried to detect by ChangeDataHolderEvent.ValueChange, but the event didn’t react on my fly
But it rected when i runned or shifted for eample
Are you sure?

Yeah. Im sure. The event must still be being implemented. Ill put a issue into Sponge API for ya.

Edit. Here ya are:

1 Like