HelpChat Wiki
  • Welcome
  • HelpChat Plugins
    • ChatChat
      • Commands
      • Permissions
      • Formats
      • Channels
      • Mentions
      • Placeholders
      • API
        • Getting Started
        • ChatChatAPI
        • Events
      • Files
    • DeluxeMenus
      • Commands & Permissions
      • Options & Configurations
        • GUI
        • Item
        • Requirements
        • Command Registration
      • Meta (Metadata)
      • External menus
      • Example GUI menus
      • Plugin's files
    • DeluxeTags
      • Commands & Permissions
      • Placeholders
      • Plugin's files
    • PlaceholderAPI
  • Clip's Plugins
    • AutoSell
      • Commands & Permissions
      • Placeholders
      • Plugin's files
    • ActionAnnouncer
      • Commands & Permissions
      • Plugin's files
      • API
    • ChatReaction
      • Commands & Permissions
      • Plugin's files
    • DeluxeChat
      • Installation
      • Commands & Permissions
      • Placeholders
      • Config options
      • Plugin's files
    • DeluxeCommands
      • Commands & Permissions
      • Plugin's files
    • DeluxeJoin
      • Commands & Permissions
      • Plugin's files
    • EzRanksPro
      • Commands & Permissions
      • Configuration
    • EzPrestige
      • Commands & Permissions
      • Configuration
    • InventoryFull
      • Commands & Permissions
      • Configuration
    • MessageAnnouncer
      • Commands & Permissions
      • Configuration
    • MineCrates
      • Commands & Permissions
      • Configuration
    • NoFlyZone
      • Commands & Permissions
      • Configuration
  • Funnycube's Plugins
    • CowPunch
      • Commands & Permissions
    • Firework Chests
      • Commands & Permissions
      • Configuration
    • Fish Slapper
      • Commands & Permissions
      • Configuration
    • RawMsg
      • Commands & Permissions
    • Spit
      • Commands & Permissions
    • Temp MOTD
      • Commands & Permissions
      • Configuration
  • Glare's Plugins
    • Guilds [W.I.P Migration]
      • Installation
      • Configuration
        • Buffs
        • Config
        • Roles
        • Tiers
      • Commands & Permissions
      • Placeholders
      • Developer API
    • VoteParty
      • Commands & Permissions
      • Placeholders
      • Configuration
      • API
      • Changelogs
        • v2.30
        • v2.29
        • v2.28
        • v2.27
        • v2.26
        • v2.25
        • v2.24
        • v2.23
        • v2.22
        • v2.21
        • v2.20
        • v2.19
        • v2.18
        • v2.17
        • v2.16
        • v2.15
        • v2.14
        • v2.13
        • v2.12
        • v2.11
        • v2.10
        • v2.9
        • v2.8
        • v2.7
        • v2.6
        • v2.5
        • v2.4
        • v2.3
        • v2.2
        • v2.1
  • piggy's barn
    • Java
      • Gradle
        • Argument
        • Tutorial
      • How to run your minecraft server(s) in IntelliJ
      • How to run your program in IntelliJ
      • Hot Swapping
      • Cheat Sheet
  • ADDITIONAL RESOURCES
    • Discord
    • Paste
    • YAML Parser
    • Java Docs
Powered by GitBook
On this page
  • ChatChatEvent
  • PMSendEvent
  • ChannelMentionEvent
  • PersonalMentionEvent
  • MentionEvent
  • Example
Edit on GitHub
  1. HelpChat Plugins
  2. ChatChat
  3. API

Events

ChatChat triggers a few events. You can find a list with all the events on this page.

ChatChatEvent

The event is fired whenever a public chat message is being processed and about to be sent.

PMSendEvent

The event is fired when a private message is being processed and about to be sent.

ChannelMentionEvent

The event is fired when a user is mentioned in a public message using a channel mention such as: @here, @everyone, @channel

PersonalMentionEvent

The event is fired when a user is mentioned in a public message using a direct mention such as: @BlitzOffline

MentionEvent

The event is fired whenever a user is mentioned in a public message thru a channel mention or a direct mention.

Example

Example of a class listening to the ChatChatEvent and canceling it if the sender's name is BlitzOffline.

package at.helpch.example.listener;

import at.helpch.chatchat.api.event.ChatChatEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

public class ChatChatEventListener implements Listener {

    @EventHandler(ignoreCancelled = true)
    public void onChatChatEvent(final ChatChatEvent event) {
        if (event.user().player().getName().equals("BlitzOffline")) {
            event.setCancelled(true);
            return;
        }
    }
}
PreviousChatChatAPINextFiles

Last updated 2 years ago