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.
This adds 7 more spigot events for use in your server, namely:
PlayerReceiveMessageEvent
Fired when a player receives a message from the server.
Methods
Player PlayerReceiveMessageEvent#getPlayer()
EnumWrappers.ChatType PlayerReceiveMessageEvent#getType()
WrappedChatComponent getMessage()
// toPlainText returns getMessage() in text format, instead of JSON.
String toPlainText()
boolean PlayerReceiveMessageEvent#isCancelled()
void PlayerReceiveMessageEvent#setCancelled(boolean)
PlayerCameraChangeEvent
This fires when a player's camera changes, i.e when they left click a player in spectator mode.
Methods
Player PlayerCameraChangeEvent#getPlayer()
Entity PlayerCameraChangeEvent#getCamera()
boolean PlayerCameraChangeEvent#isCancelled()
void PlayerCameraChangeEvent#setCancelled(boolean)
PlayerElderGuardianEffectEvent
Fired when a player is inflicted with mining fatigue from an elder guardian.
Methods
Player PlayerElderGuardianEffectEvent#getPlayer()
boolean PlayerElderGuardianEffectEvent#isCancelled()
// 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.
void PlayerElderGuardianEffectEvent#setCancelled(boolean)
PlayerListUpdateEvent
Fired when the player receives the header and/or footer in the player list. This will never fire on a vanilla server.
Methods
Player PlayerListUpdateEvent#getPlayer()
BaseComponent[] PlayerListUpdateEvent#getHeader()
BaseComponent[] PlayerListUpdateEvent#getFooter()
boolean PlayerListUpdateEvent#isCancelled()
void PlayerListUpdateEvent#setCancelled(boolean)
PlayerOpenSignEditorEvent
Fired when a player opens the sign editor, i.e when they place a sign.
Methods
Player PlayerOpenSignEditorEvent#getPlayer()
// Note that chunk position only stores X, Y and Z, not the world.
ChunkPosition PlayerOpenSignEditorEvent#getPosition()
boolean PlayerOpenSignEditorEvent#isCancelled()
// Cancelling this event will make the client place an empty sign.
void PlayerOpenSignEditorEvent#setCancelled(boolean)
PlayerReceiveStatisticsEvent
Fired when the server sends the client its statistics
Methods
Player PlayerReceiveStatisticsEvent#getPlayer()
int PlayerReceiveStatisticsEvent#getStatistic(WrappedStatistic)
int PlayerReceiveStatisticsEvent#getStatistic(String)
Map<WrappedStatistic, Integer> PlayerReceiveStatisticsEvent#getStatistics()
PlayerSettingsUpdateEvent
Fired when the client updates their settings. They may be the same as their previous settings.
Methods
Player PlayerSettingsUpdateEvent#getPlayer()
ClientSettings PlayerSettingsUpdateEvent#getSettings()
String ClientSettings#getLocale()
int ClientSettings#getViewDistance()
// The chat visibility of the client. Can be all, commands only, or hidden.
EnumWrappers.ChatVisibility ClientSettings#getMode()
// Get whether the client has colours enabled in their chat
boolean ClientSettings#isEnableColours()
// Gets the enabled skin parts for client
SkinParts ClientSettings#getSkinParts()
// Get whether the client is set as left-handed or right-handed.
EnumMainHand ClientSettings#getMainHand()
Usage
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.
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta