Respawn the player automatically on death

feature/embed-uploads
Tristan Gosselin-Hane 7 years ago
parent 68d2055707
commit 54121ad015
  1. 11
      webhook-bridge.py

@ -149,6 +149,17 @@ def main():
connection.register_packet_listener(
print_chat, clientbound.play.ChatMessagePacket)
def handle_health_update(health_update_packet):
if health_update_packet.health <= 0:
#We need to respawn!!!!
print("Respawned the player because it died!")
packet = serverbound.play.ClientStatusPacket()
packet.action_id = serverbound.play.ClientStatusPacket.RESPAWN
connection.write_packet(packet)
connection.register_packet_listener(
handle_health_update, clientbound.play.UpdateHealthPacket)
connection.connect()
@discord_bot.event

Loading…
Cancel
Save