Skip to content

Commit

Permalink
feat: add event handler for ActorKnockbackEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Sep 3, 2024
1 parent 715c2f9 commit 802f7e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/endstone_test/event_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def on_player_teleport(self, event: PlayerTeleportEvent):
def on_actor_death(self, event: ActorDeathEvent):
self._plugin.logger.info(f"{event.actor.name} died.")

@event_handler
def on_actor_knockback(self, event: ActorKnockbackEvent):
self._plugin.logger.info(f"{event.actor.name} is knocked by {event.knockback}")

@event_handler
def on_actor_removed(self, event: ActorRemoveEvent):
self._plugin.logger.info(f"{event.actor.name} is removed from the world.")
Expand Down

0 comments on commit 802f7e7

Please sign in to comment.