-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1472f2
commit 1e51056
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
When using an official platform-implementation of the LabyMod Server API, you can listen to the following events that | ||
are fired by the API: | ||
|
||
## LabyModPlayerJoinEvent | ||
|
||
The `LabyModPlayerJoinEvent` is fired after a player has sent | ||
the [VersionLoginPacket](/pages/server/labymod/moderation/labymod-version/) to the server. | ||
|
||
???+ danger "Important Note" | ||
|
||
The `LabyModPlayer` object of the player is not available before this event is fired. It is fired **after** the join event of the respective server platform (f.e. `PlayerJoinEvent` on Bukkit). | ||
|
||
The following methods are available in this event: | ||
|
||
- `#labyModPlayer()` - Returns the `LabyModPlayer` object of the player. | ||
- `#protocolService()` - Returns the `LabyModProtocolService` instance. | ||
|
||
## LabyModPacketSentEvent | ||
|
||
The `LabyModPacketSentEvent` is fired **after** a packet has been sent to a player. | ||
|
||
The following methods are available in this event: | ||
|
||
- `#packet()` - Returns the packet that has been sent. | ||
- `#protocolService()` - Returns the `LabyModProtocolService` instance. | ||
- `#protocol()` - The protocol that the packet has been sent with. | ||
- `#getReceiver()` - Returns the unique id player that the packet has been sent to. | ||
- `#getLabyModPlayer()` - Returns the `LabyModPlayer` object of the player that the packet has been sent to. **Can | ||
be `null` if it's not a LabyMod player.** | ||
|
||
## LabyModPacketReceiveEvent | ||
|
||
The `LabyModPacketReceiveEvent` is fired **after** a packet has been received from a player (and after all registered | ||
packet handlers have handled the packet). | ||
|
||
The following methods are available in this event: | ||
|
||
- `#packet()` - Returns the packet that was sent by the player. | ||
- `#protocolService()` - Returns the `LabyModProtocolService` instance. | ||
- `#protocol()` - The protocol that the packet was received on. | ||
- `#getSender()` - Returns the unique id player that has sent the packet. | ||
- `#getLabyModPlayer()` - Returns the `LabyModPlayer` object of the player that has sent the packet. **Can be `null` if | ||
it's not a LabyMod player.** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters