Skip to content

Commit

Permalink
feat: add an example of Server.dispatch_command
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Jun 4, 2024
1 parent 6373a74 commit 9f7def6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/endstone_example/example_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def on_server_load(self, event: ServerLoadEvent):

@event_handler(priority=EventPriority.HIGH)
def on_server_load_2(self, event: ServerLoadEvent):
self.logger.info(f"{event.event_name} is passed to on_server_load_2. This will be called after on_server_load.")
# this will be called after on_server_load because of a higher priority
self.server.dispatch_command(self.server.command_sender, "say Hello world!")

def log_time(self):
now = datetime.datetime.now().strftime("%c")
Expand Down

0 comments on commit 9f7def6

Please sign in to comment.