UltraStaffChatPro API
The official Developer API of UltraStaffChatPro.

Adding USCPAPI to your Project

Remember to add UltraStaffChatPro to your plugin's dependencies in your plugin.yml file!
Current Version: 1.0.0
Maven
Gradle
1
<repository>
2
<id>joshualovescode</id>
3
<url>https://repo.joshualovescode.dev/releases</url>
4
</repository>
Copied!
1
<dependency>
2
<groupId>dev.joshualovescode</groupId>
3
<artifactId>USCPAPI</artifactId>
4
<version>VERSION</version>
5
</dependency>
Copied!
1
allprojects {
2
repositories {
3
...
4
maven { url 'https://repo.joshualovescode.dev/releases' }
5
}
6
}
Copied!
1
dependencies {
2
implementation 'dev.joshualovescode:USCPAPI:VERSION'
3
}
Copied!

Events

Registering Listener

1
@Override
2
public void onEnable() {
3
getLogger().info("Plugin Enabled!");
4
5
EventManager eventManager = UltraStaffChatProAPI.getEventManager();
6
7
eventManager.registerListener(getDescription().getName(), new MyUSCPListener());
8
}
Copied!

Listener

1
public class MyUSCPListener implements USCPListener {
2
@Override
3
public void onMessageReceived(USCPMessageEvent uscpMessageEvent) {
4
// Do something with message.
5
getLogger().info("[MESSAGE] "+uscpMessageEvent.getMessage().getPlayerName() + ": "+uscpMessageEvent.getMessage().getMessage());
6
}
7
}
Copied!

Sending messages to USCP

StaffChat

1
UltraStaffChatProAPI.getAPI().sendMessage(new USCPMessage("PlayerName", "ServerName", "Message");
Copied!

MultiChannel

1
UltraStaffChatPro.getAPI().sendMessage(new USCPMessage("ChannelName", "PlayerName", "ServerName", "Message");
Copied!
Last modified 1yr ago