Event: | "player.preLogin"
Module: | clientconnection.py (client/clientconnection.py)
|
Description: | Called before client logs on. This event marks the
birth of the player object in wrapper (when in proxy mode)
|
Payload: |
"playername": | self.username, |
"player": | Player object will be created by the event code |
"online_uuid": | online UUID, |
"server_uuid": | UUID on local server (offline), |
"ip": | the user/client IP on the internet. |
"secure_connection": | Proxy's online mode |
|
Can be aborted/modified: | Yes, return False to disconnect the client.
|
Comments: |
- If aborted, the client is disconnnected with message
"Login denied by a Plugin."
- Event occurs after proxy ban code runs right after a
successful handshake with Proxy.
|
|
Event: | "player.rawMessage"
Module: | parse_sb.py (client/parse_sb.py)
|
Description: | Raw message from client to server.
Contains the "/", if present.
|
Payload: |
"player": | player object |
"playername": | player's name |
"message": | the chat message string. |
|
Can be aborted/modified: | Yes
|
Comments: | Can be aborted by returning False. Can be modified before
passing to server. 'chatmsg' accepts both raw string
or a dictionary payload containing ["message"] item.
|
|
Event: | "player.dig"
Module: | parse_sb.py (client/parse_sb.py)
|
Description: | When a player attempts to dig. This event
only supports starting and finishing a dig.
|
Payload: |
"playername": | player's name |
"player": | player object |
"position": | x, y, z block position |
"action": | begin_break or end_break (string) |
"face": | 0-5 (bottom, top, north, south, west, east) |
|
Can be aborted/modified: | Yes
|
Comments: | Can be aborted by returning False. Note that the client
may still believe the block is broken (or being broken).
If you intend to abort the dig, it should be done at
"begin_break". Sending a false bedrock to the client's
digging position will help prevent the client from
sending "end_break"
|
|
Event: | "player.interact"
Module: | parse_sb.py (client/parse_sb.py)
|
Description: | Called when the client is eating food,
pulling back bows, using buckets, etc.
|
Payload: |
"playername": | player's name |
"player": | player object |
"position": | the PLAYERS position - x, y, z, pitch, yaw |
"action": | "finish_using" or "use_item" |
"hand": | 0 = main hand, 1 = off hand (shield). |
"origin": | Debugging information on where event was parsed.
Either 'pktSB.PLAYER_DIGGING' or 'pktSB.USE_ITEM' |
|
Can be aborted/modified: | Yes
|
Comments: | Can be aborted by returning False. Note that the client
may still believe the action happened, but the server
will act as though the event did not happen. This
could be confusing to a player. If the event is aborted,
consider some feedback to the client (a message, fake
particles, etc.)
|
|
Event: | "player.place"
Module: | parse_sb.py (client/parse_sb.py)
|
Description: | Called when the client places an item
|
Payload: |
"playername": | player's name |
"player": | player object |
"position": | the clicked position, corrected for 'face' (i.e.,
the adjoining block position) |
"clickposition": | The position of the block that was actually
clicked |
"item": | The item player is holding (item['id'] = -1 if no item) |
"hand": | hand in use (0 or 1) |
|
Can be aborted/modified: | Yes
|
Comments: | Can be aborted by returning False. Note that the client
may still believe the action happened, but the server
will act as though the event did not happen. This
could be confusing to a player. If the event is aborted,
consider some feedback to the client (a message, fake
block, etc.)
|
|
Event: | "player.createSign"
Module: | parse_sb.py (client/parse_sb.py)
|
Description: | When a player creates a sign and finishes editing it
|
Payload: |
"player": | player object |
"playername": | player's name |
"position": | position of sign |
"line1": | l1 |
"line2": | l2 |
"line3": | l3 |
"line4": | l4 |
|
Can be aborted/modified: | Yes
|
Comments: | Can be aborted by returning False.
Any of the four line arguments can be changed by
returning a dictionary payload containing the lines
you want replaced:
return {"line2": "You can't write", "line3": "that!"}
|
|
Event: | "player.slotClick"
Module: | parse_sb.py (client/parse_sb.py)
|
Description: | When a player clicks a window slot
|
Payload: |
"player": | Player object |
"playername": | the player's name |
"wid": | window id ... always 0 for inventory |
"slot": | slot number |
"button": | mouse / key button |
"action": | unique action id - incrementing counter |
"mode": | varint:mode - see the wiki? |
"clicked": | item data |
|
Can be aborted/modified: | Yes
|
Comments: | Can be aborted by returning False. Aborting is not recommended
since that is how wrapper keeps tabs on inventory.
|
|
Event: | "player.chatbox"
Module: | parse_cb.py (server/parse_cb.py)
|
Description: | Chat message sent from the server to the client.
|
Payload: |
"playername": | client username |
"player": | player object |
"json": | json or string data |
|
Can be aborted/modified: | Yes
|
Comments: |
- The message will not reach the client if the event is returned False.
- If json chat (dict) or text is returned, that value will be sent
to the client instead.
|
|
Event: | "player.usebed"
Module: | parse_cb.py (server/parse_cb.py)
|
Description: | Sent when server sends client to bedmode.
|
Payload: |
"playername": | client username |
"player": | player object |
"position": | position of bed |
|
Can be aborted/modified: | No - The server thinks the client is in bed already.
|
|
Event: | "player.spawned"
Module: | parse_cb.py (server/parse_cb.py)
|
Description: | Sent when server advises the client of the Spawn position.
|
Payload: |
"playername": | client username |
"player": | player object |
"position": | Spawn's position |
|
Can be aborted/modified: | No - Notification only.
|
Comments: | Sent by the server after login to specify the coordinates of the spawn point (the point at which players spawn at, and which the compass points to). It can be sent at any time to update the point compasses point at.
|
|
Event: | "entity.unmount"
Module: | parse_cb.py (server/parse_cb.py)
|
Description: | Sent when player attaches to entity.
|
Payload: |
"playername": | client username |
"player": | player object |
"vehicle_id": | EID of vehicle or MOB |
"leash": | leash True/False |
|
Can be aborted/modified: | No - Notification only.
|
Comments: | Only works if entity controls are enabled. Entity controls
add significant load to wrapper's packet parsing and is off by default.
|
|
Event: | "entity.mount"
Module: | parse_cb.py (server/parse_cb.py)
|
Description: | Sent when player detaches/unmounts entity.
|
Payload: |
"playername": | client username |
"player": | player object |
"vehicle_id": | EID of vehicle or MOB |
"leash": | leash True/False |
|
Can be aborted/modified: | No - Notification only.
|
Comments: | Only works if entity controls are enabled. Entity controls
add significant load to wrapper's packet parsing and is off by default.
|
|