Is there some type of list of events for Sponge, because it is very difficult to locate the events I need (using the javadocs). It took me forever to find that the player join event in Sponge is ClientConnectionEvent.Join
(And I’m currently very frustrated trying to find the Sponge equivalent of PlayerToggleFlightEvent)
Unless I’m mistaken, the Data API crew is working on a so-called “DataEvent” that fires when a data holder’s data is updated. This would handle flight toggling, and a great many other things. Would have to ask @gabizou about it though…
Javadocs has been the best resource I’ve found so far for finding all the events. Specifically the Event Interface page (You may have to do a bit of digging, but they are all there).
As far as your second question, I don’t believe there is a sponge equivalent of the PlayerToggleFlightEvent. However, you may be able to achieve a similar check by listening to the ChangeDataHolderEvent.ValueChange, filtering for players, and specifically checking to see if the DataTransactionResult contains a BaseValue representing FlyingData If it does then the player has toggled flight.
I don’t think ChangeDataHolderEvent is what I’m looking for, I tried all it’s variations and that event never fired.
It seems at the current stage of Sponge that the closest I can get to what I want is checking each move event.
That means it’s not implemented yet, not that it’s not the right one to go with.
And rather than the first word of the class name being the hint, class names are named more intelligently, and you use packages to find what you’re looking for.