This plugin depends on ProtocolLib. If you do not have it, download it here. You may also add it as a dependency for your plugin, as some of the objects returned by the API are part of ProtocolLib's library.
- Tested Minecraft Versions:
- Source Code:
This adds 7 more spigot events for use in your server, namely:
Fired when a player receives a message from the server.
PlayerCameraChangeEventCode (Text):Player PlayerReceiveMessageEvent#getPlayer()
// toPlainText returns getMessage() in text format, instead of JSON.
This fires when a player's camera changes, i.e when they left click a player in spectator mode.
Code (Text):Player PlayerCameraChangeEvent#getPlayer()
Fired when a player is inflicted with mining fatigue from an elder guardian.
PlayerListUpdateEventCode (Text):Player PlayerElderGuardianEffectEvent#getPlayer()
// Note that if this event is cancelled, the player will still be affected by
// mining fatigue but will not receive the sound effect nor the visual effect.
Fired when the player receives the header and/or footer in the player list. This will never fire on a vanilla server.
Code (Text):Player PlayerListUpdateEvent#getPlayer()
Fired when a player opens the sign editor, i.e when they place a sign.
PlayerReceiveStatisticsEventCode (Text):Player PlayerOpenSignEditorEvent#getPlayer()
// Note that chunk position only stores X, Y and Z, not the world.
// Cancelling this event will make the client place an empty sign.
Fired when the server sends the client its statistics
Code (Text):Player PlayerReceiveStatisticsEvent#getPlayer()
Map<WrappedStatistic, Integer> PlayerReceiveStatisticsEvent#getStatistics()
Fired when the client updates their settings. They may be the same as their previous settings.
UsageCode (Text):Player PlayerSettingsUpdateEvent#getPlayer()
// The chat visibility of the client. Can be all, commands only, or hidden.
// Get whether the client has colours enabled in their chat
// Gets the enabled skin parts for client
// Get whether the client is set as left-handed or right-handed.
The events should be listened to as you would standard spigot events. Remember to add depend: [MoreSpigotEvents, ProtocolLib] in your plugin.yml to make sure that this plugin is loaded before yours is. ProtocolLib is there because some of the objects MoreSpgiotEvent returns are from ProtocolLib.
Be sure to send me a PM if you have any suggestions.
If you need an example, I used this class to help debug the plugin, so it may help you understand its API if you're unsure.