- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Staff Pick: Ban Notifier


By Mergu
Created: 2018/12/14 21:51:02 UTC-08:00 (5 years and 134 days ago)
Edited: 2018/12/14 21:51:02 UTC-08:00 (5 years and 134 days ago)
Likes: 0

Staff pick as of: 2019/02/15 00:06:38 UTC-08:00 (5 years and 72 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 script
1
2
3
4
5
6
7
8
9
10
11
12
13
1300

ban_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