Staff Pick: Ban Notifier
By
MerguCreated: 2018/12/14 21:51:02 UTC-08:00 (6 years and 71 days ago)
Edited: 2018/12/14 21:51:02 UTC-08:00 (6 years and 71 days ago)
Likes: 0
Staff pick as of: 2019/02/15 00:06:38 UTC-08:00 (6 years and 9 days ago)
Denizen Version: 1.0.3
Script Version: 1.0.0
Description:
Super simple script to notify users when a banned player tries to join. Displays their username, ip address, ban reason, ban creation date, ban expiration date, ban duration, and remaining ban time.
This is a permission-based script. Opped players and those with the `denizen.ban_notifier` permission will receive these notifications.
Download script |
View raw scriptban_notifier:
type: world
debug: false
events:
on player login:
- if !<player.is_banned> queue clear
- define targets <server.list_online_players.filter[has_permission[denizen.ban_notifier]]>
- define creation <player.ban_info.created||null>
- define expiration <player.ban_info.expiration||null>
- narrate "<&c>[Ban Notifier]<&7> Banned player <&c><player.name><&7> tried to join from <&c><c.hostname.after[/]><&7>." targets:<def[targets]>
- narrate " <&c>Reason<&co> <&7><player.ban_info.reason||None>" targets:<def[targets]>
- narrate " <&c>Duration<&co> <&7><def[creation].time||Unknown> - <def[expiration].time||Never> (<&c><def[expiration].sub[<def[creation]>].formatted||?><&7> <&pipe> <&c><def[expiration].sub[<util.date.time.duration>].formatted||?><&7>)" targets:<def[targets]>
View History