Pages » Sunlight » Modules » Chat


Commands

Command Aliases Description Player only Permission(s)
/adminchat - Enter to admin chat channel. Yes sunlight.chat.cmd.adminchat


Permissions

Permission Description
sunlight.chat.color Allows to use colors in chat messages and commands.
sunlight.chat.spy Allows to see local player chat messages.
sunlight.chat.bypass.delay.msg Bypasses the anti-spam message delay.
sunlight.chat.bypass.delay.cmd Bypasses the anti-spam command delay.
sunlight.chat.bypass.anticaps Bypasses the anti-caps checks.
sunlight.chat.bypass.antispam Bypasses the anti-spam checks.
sunlight.chat.bypass.rules Bypasses the chat rules checks.

Config

# Makes message with certain caps percentage to lower case messages.
anti-caps:
  # Enable/Disable anti-caps system.
  enabled: true
  # Min. message length to check for caps.
  min-length: 3
  # Min. percentage of upper case chars to make message in lower case.
  min-percentage: 70
  # List of commands, where anti-caps will have effect.
  # Command aliases are auto-detected.
  affected-commands:
  - me
  - broadcast
  - tell
  # List of words that will be ignored.
  ignored-words:
  - OMG
  - LOL
  - WTF
  - WOW
  - ROFL

# Prevents from spam and flood messages and commands.
anti-spam:
  # Enable/Disable anti-spam system.
  enabled: true
  # Min. percentage of similarity between the current and previous player message or command to cancel it due to spam.
  similarity-percentage: 90
  # Delay (in seconds) before player is able to send next message/command.
  delay:
    chat: 1.25
    command: 1.25
  # List of commands that will be ignored by anti-spam system.
  # Command aliases are auto-detected.
  ignored-commands:
  - tell
  - spawn
  - home
  - sethome
  - reply
  - stats
  - kit
  - warp

# Custom join and quit messages depends on player rank.
# Placeholders:
# - %player% - Player display name (support custom names from /nick command).
# PlaceholderAPI is supported here.
join-and-quit:
  enabled: true
  join-groups:
    Admins: '&7[&2+&7] &7Admin &2%player% &7has joined the game.'
  quit-groups:
    Admins: '&7[&4-&7] &7Admin &4%player% &7has left the game.'

# Provides an ability to show hand item in chat.
item-link:
  # Enable/Disable item link feature.
  enabled: true
  # Placeholder to replace with item name and lore.
  keyword: '@hand'
  # Item name format.
  format: '&7<&f%item%&7>&f'

# Custom death messages depends on damage cause or killer.
# Placeholders:
# - %player% - Player display name (support custom names from /nick command).
# - %damager% - Killer display name (support custom names from /nick command).
# PlaceholderAPI is supported here.
death-messages:
  # Enable/Disable death messages.
  enabled: true
  # Messages appear when player dies after receive damage from certain Damage Cause.
  by-cause:
    LAVA:
    - '&7(&c☠&7) &c%player% &7drowned in lava.'
    BLOCK_EXPLOSION:
    - '&7(&c☠&7) &c%player% &7blowed up!'
  # Messages appear when player dies being killed by certain Entity.
  by-entity:
    PLAYER:
    - '&7(&c⚔&7) &c%damager% &7killed &c%player%'
    ZOMBIE:
    - '&7(&c☠&7) &c%player%&7''s brains has been eaten by zombie.'

# Auto-announcer.
announcer:
  # Enable/Disable auto-announcer.
  enabled: true
  # When false messages will appear in the same order as in config.
  random-order: true
  # Interval (in seconds) between the messages.
  interval: 180
  # List of messages.
  # PlaceholderAPI is supported here.
  # JSON is supported here. Allowed params: chat-type, chat-suggest, hint, url.
  messages:
    info1:
    - '&7'
    - '&e&m    &8&m                        &c   *   &8&m                     &e&m    &7'
    - '&e  Get awesome perks by buying a rank on our store!'
    - '&b               http://store.samplecraft.com/'
    - '&e&m    &8&m                        &c   *   &8&m                     &e&m    &7'
    - '&7'
    info2:
    - '&7'
    - '&e&m    &8&m                        &c   *   &8&m                     &e&m    &7'
    - '&e  This announcer can display JSON messages!'
    - '&b              {json: ~hint: &bHey, &d%player%&b!;}[Hover Me]{end-json}    &8|&b    {json: ~hint: &7Click to say &e"Hello!"; ~chat-type: Hello!;}[Click Me]{end-json}'
    - '&e&m    &8&m                        &c   *   &8&m                     &e&m    &7'
    - '&7'

# Chat format.
# Placeholders:
# {player_prefix} - Player rank prefix.
# {player_suffix} - Player rank suffix.
# {display_name} - Player display name (support custom names from /nick command).
# {name} - Real player name.
# {world} - Player world name.
# {message} - Message.
# PlaceholderAPI is supported here.
chat:
  format:
    local: '&7(&3Local&7) &7{player_prefix}{display_name}{player_suffix}:&f {message}'
    global: '&7(&6Global&7) &7{player_prefix}{display_name}{player_suffix}:&f {message}'
    spy: '&7(&cSpy&7) &7{world} {name}:&7 {message}'
    admin: '&7(&bAdmin-Chat&7) &7{player_prefix}{display_name}{player_suffix}:&f {message}'
    # Local chat range.
    # Set to -1 to disable local chat.
    range: 100.0

Chat Rules

# Rule punishment settings.
punishment:
  # Custom Actions that will be executed when rule is broken.
  custom-actions:
    default:
      target-selectors:
        self:
        - '[SELF]'
      conditions:
        list: []
        actions-on-fail: 'null'
      action-executors:
      - '[MESSAGE] ~message: &cChat &8> &7Your message have been cancelled: &cAdvertisement&7.; ~target: self;'

# Rules.
rules:
  # Rule identified. Must be unique.
  ips:
    # Rule regular expression.
    # You can test it here: http://myregexp.com.
    match: \b[0-9]{1,3}(\.|dot|\(dot\)|-|;|:|,|(\W|\d|_)*\s)+[0-9]{1,3}(\.|dot|\(dot\)|-|;|:|,|(\W|\d|_)*\s)+[0-9]{1,3}(\.|dot|\(dot\)|-|;|:|,|(\W|\d|_)*\s)+[0-9]{1,3}\b
    # Rule action.
    # Allowed actions:
    # - DENY - Cancels the message.
    # - REPLACE - Replaces the 'bad' word(s) by certain text.
    # - REPLACE_FULL - Replaces the whole message by certain text.
    action: DENY
    # Text to replace with.
    replace-with: '***'
    # List of ignored words.
    ignored-words:
    - 127.0.0.1
  domain:
    match: '[a-zA-Z0-9\-\.]+\s?(\.|dot|\(dot\)|-|;|:|,)\s?(com|ro|org|net|cz|co|uk|sk|biz|mobi|xxx|eu|me|io|ru|su|tk|ua)\b'
    action: DENY
    replace-with: '***'
    ignored-words:
    - google.com
    - spigotmc.org
    - play.myservername.com
18+