Skip to content

UserBanEvent and UserPardonEvent #6082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Zkir opened this issue Mar 6, 2025 · 1 comment
Open

UserBanEvent and UserPardonEvent #6082

Zkir opened this issue Mar 6, 2025 · 1 comment
Labels
type: enhancement Features and feature requests.

Comments

@Zkir
Copy link

Zkir commented Mar 6, 2025

Feature description

Add the new events: UserBanEvent and UserPardonEvent, which should be raised when user is banned or pardoned via essentials /ban or /pardon (/unban) commands respectively.

Those events will be similar to the UserKickEvent, with the difference that those events will be called for offline players (UserKickEvent is raised only for online player, but a player who is currently offline can be banned also, and obviously only offline player can be pardoned).

P.S.
The feature seems to be quite easy to implement (2 new event classes and 2 lines of code to call them).

How the feature is useful

Those events will be useful for plugin developers who need to monitor administrative actions.

In my project I need to send instant messages to inform banned/pardoned players to inform them about their status (on our server offline players often get banned, when moderators find results of their misbehavior, and also to display the log of moderator actions on our site.

@Zkir Zkir added the type: enhancement Features and feature requests. label Mar 6, 2025
@Zkir
Copy link
Author

Zkir commented Mar 7, 2025

Possible solution can be like this. A bit longer then 2 lines of code, but still.

Cosmetic change to existing code: banned or pardoned player is called target, command sender is called user, as in existing kick command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Features and feature requests.
Projects
None yet
Development

No branches or pull requests

1 participant