From 6373a749349b06ca417087eacf643867b73eb83a Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 3 Jun 2024 09:17:50 +0100 Subject: [PATCH] feat: add example of explicitly removing one's permission of using a given command --- src/endstone_example/example_listener.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/endstone_example/example_listener.py b/src/endstone_example/example_listener.py index 6d62b09..df3e789 100644 --- a/src/endstone_example/example_listener.py +++ b/src/endstone_example/example_listener.py @@ -18,10 +18,13 @@ def on_server_list_ping(self, event: ServerListPingEvent): def on_player_join(self, event: PlayerJoinEvent): player = event.player self._plugin.logger.info( - ColorFormat.YELLOW - + f"{player.name}[/{player.address}] joined the game with UUID {player.unique_id}" + ColorFormat.YELLOW + f"{player.name}[/{player.address}] joined the game with UUID {player.unique_id}" ) + # example of explicitly removing one's permission of using /me command + player.add_attachment(self._plugin, "minecraft.command.me", False) + player.update_commands() # don't forget to resend the commands + @event_handler def on_player_quit(self, event: PlayerQuitEvent): player = event.player