Skip to content

Commit 9f7def6

Browse files
committed
feat: add an example of Server.dispatch_command
1 parent 6373a74 commit 9f7def6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/endstone_example/example_plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ def on_server_load(self, event: ServerLoadEvent):
107107

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

112113
def log_time(self):
113114
now = datetime.datetime.now().strftime("%c")

0 commit comments

Comments
 (0)