Skip to content

Commit 6373a74

Browse files
committed
feat: add example of explicitly removing one's permission of using a given command
1 parent 44dd3ec commit 6373a74

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/endstone_example/example_listener.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ def on_server_list_ping(self, event: ServerListPingEvent):
1818
def on_player_join(self, event: PlayerJoinEvent):
1919
player = event.player
2020
self._plugin.logger.info(
21-
ColorFormat.YELLOW
22-
+ f"{player.name}[/{player.address}] joined the game with UUID {player.unique_id}"
21+
ColorFormat.YELLOW + f"{player.name}[/{player.address}] joined the game with UUID {player.unique_id}"
2322
)
2423

24+
# example of explicitly removing one's permission of using /me command
25+
player.add_attachment(self._plugin, "minecraft.command.me", False)
26+
player.update_commands() # don't forget to resend the commands
27+
2528
@event_handler
2629
def on_player_quit(self, event: PlayerQuitEvent):
2730
player = event.player

0 commit comments

Comments
 (0)