Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asintotoo/cmodapi
The Official API for CMod
https://github.com/asintotoo/cmodapi
api chat-moderation cmod minecraft plugin spigot spigot-plugin
Last synced: about 1 month ago
JSON representation
The Official API for CMod
- Host: GitHub
- URL: https://github.com/asintotoo/cmodapi
- Owner: Asintotoo
- Created: 2024-05-22T17:17:50.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-28T09:19:39.000Z (6 months ago)
- Last Synced: 2024-06-28T10:42:02.844Z (6 months ago)
- Topics: api, chat-moderation, cmod, minecraft, plugin, spigot, spigot-plugin
- Language: Java
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## CModAPI - The Official API for CMod
**Note**: These features are still *Work in Progress*, this might not work as intended!
How to include the API:
Simple download the latest version from [here](https://github.com/Asintotoo/CModAPI/releases) and include it in your Spigot Plugin.
Make sure it is the same version as CMod's in order to use the API full potential.Current Features:
- Event *CModFlagEvent* fired when a flag is sent
- Event *CModPunishmentEvent* fired when a punishment is run
- Enum *CheckType* which contains all the current checks avaible in the pluginExample Usage:
```java
public class YourEvent implements Listener{
@EventHandler
public void onCModFlag(CModFlagEvent event) {
if(event.getCheckType == CheckType.CHAT_A) {
Player p = event.getPlayer();
p.sendMessage("You got lucky! I cancelled the event, you won't be punished!")
event.setCancelled(true);
}
}
}
```
This will check if the flag referes to a "Chat A" check and, if so, it will cancel the event and send a message to the player.