- Some changes to variable naming, and changing player to UUID of player (to avoid console warnings).
- Changed the error thrown in the custom event which told the user that the event wasn't registered to be a warning instead.
- Made functions local.