Skip to content

Commit

Permalink
feat: add example of explicitly removing one's permission of using a …
Browse files Browse the repository at this point in the history
…given command
  • Loading branch information
wu-vincent committed Jun 3, 2024
1 parent 44dd3ec commit 6373a74
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/endstone_example/example_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6373a74

Please sign in to comment.