Developer API

This plugin has also API methods that allow developers to develop side-plugins.

How to import API

You have to get your copy of chatplus.jar and import it in your project (I recommend doing it from pom.xml or build.gradle) and then add ChatPlus as depend or softdepend in this way:

softdepend:
  - ChatPlus

Start using API

All of the following methods are in the ChatPlusAPI class and they are statics methods so you can call it just using ChatPlusAPI.<method>...

Method

Arguments

Description

boolean createChat()

String chatName; String color; String chatPrefix

Create a chat

boolean deleteChat()

String chatName

Delete a chat

boolean addPlayerToAChat()

String chatName, String player

Add a player to a chat

boolean removePlayerFromAChat()

String chatName; String player

Remove a player from a chat.

String getChatInfo()

String chatName;

Return a string about the info of the chat.

Inventory getChatInventory()

Player player;

Return the GUI of chats of that player.

boolean setPlayerName()

String chatName, String player, String newName

Set the player's name in that chat.

boolean setPlayerPrefix()

String chat, String player, String newPrefix

Set the player's prefix in that chat

boolean clearPlayerPrefix()

String chat, String prefix

Clear the player's prefix in that chat

boolean setGroupPrefix()

String chat, String group, String newPrefix

Set the group's prefix in that chat

boolean clearGroupPrefix()

String chat, String prefix

Clear the group's prefix in that chat

void manageVisibility()

Player p, String chat

Remove from enable list that player if the chat is enabled, enable if not or switch chat.

void returnToGlobal()

Player p;

Disable enabled chat.

void enableChat()

Player p, String chat

Enable the chat to a player

boolean sendMessage()

String chat, String message, CommandSender player

Send a message to a chat as the player.

boolean sendMessageAsDiscord()

String chat, String message, String playerName, String group

Send a message as coming from Discord from that player.

!!Note: The boolean methods returns true if goes good, false if an error occurs like chat not found. !!Note: Please consider to execute that methods async cause there a lot of reference to databases.

Last updated