https://github.com/fulminazzo/fulmichat
FulmiChat is a formatter plugin with emoji, item, mentioning and moderation capabilities.
https://github.com/fulminazzo/fulmichat
bukkit minecraft minecraft-plugin plugin spigot spigot-plugin
Last synced: about 1 month ago
JSON representation
FulmiChat is a formatter plugin with emoji, item, mentioning and moderation capabilities.
- Host: GitHub
- URL: https://github.com/fulminazzo/fulmichat
- Owner: fulminazzo
- Created: 2023-06-15T00:27:13.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-11T13:41:30.000Z (almost 3 years ago)
- Last Synced: 2025-05-30T18:21:25.264Z (about 1 year ago)
- Topics: bukkit, minecraft, minecraft-plugin, plugin, spigot, spigot-plugin
- Language: Java
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FulmiChat
FulmiChat is a simple chat plugin that allows some functionalities with given permissions to the chat.
| Table of Contents |
|-------------------|
| [Config](#Config) |
| [API](#API) |
## Config
The configuration file is divided into four sections:
| Config Contents |
|---------------------------------|
| [ModerationGUI](#ModerationGUI) |
| [Placeholders](#Placeholders) |
| [PlayerMention](#PlayerMention) |
| [Emojis](#Emojis) |
### ModerationGUI
A GUI to moderate a given player.
Users with permission fulmichat.mod will have access to the custom check in chat and to command `/moderate `.
Here's an example configuration:
```yaml
moderation-gui:
# The title of the GUI.
# %target% will be replaced with the player name
title: "&4%target% &cGUI"
# The symbol that should appear next every player
# message in chat. Can be anything.
check: "&c[✓]"
# A list of items to appear in the GUI.
# The GUI is auto-resizable, meaning that it
# if you specify more than 10 slots, it will auto-resize
# to 18, if you specify more than 19, it will
# auto-resize to 27 and so on...
items:
# The slot of the item.
0:
# The item type (check https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
# for a full list).
material: DIAMOND_AXE
# The amount of the item.
amount: 1
# The display name. Set "" to disable.
display-name: "&cBan &4%target%"
lore: []
# A list containing all the enchantments of
# the item. Format: :
enchantments:
mending: 1
sharpness: 5
unbreaking: 3
# NOTE: DON'T FORGET THIS VALUE, IT IS REQUIRED!
value-class: java.lang.Integer
# The command to be executed when clicking on the item.
command: "ban %target% The ban hammer has spoken!"
# The action to be done when clicking on the item.
# For now you can only specify "close".
action: "close"
1:
material: DIAMOND_SHOVEL
amount: 1
display-name: "&cMute &4%target%"
lore: []
enchantments: {}
command: "mute %target% Muted by %issuer%"
action: "close"
8:
material: BARRIER
amount: 1
display-name: "&cClose GUI"
lore: []
enchantments: {}
action: "close"
```
### Placeholders
The plugin offers various placeholders to be replaced with certain elements. Here is a list with all the available ones:
- _item-placeholder_: replaces with the current held item in hand;
- _inventory-placeholder_: replaces with the inventory of the player;
- _ender-placeholder_: replaces with the enderchest of the player;
- _chest-placeholder_: replaces with the container the player is looking at (for example a chest, a dispenser or a shulkerbox);
- _ping-placeholder_: replaces with the player's current ping;
You can specify every placeholder and replacement in the config.yml, for example:
```yaml
item-placeholder:
- "[item]"
- "[i]"
item-placeholder-parsed: "&8[%item%&8]"
```
means that ```[item]``` and ```[i]``` typed in chat will be replaced with the item held by the player in the format of ```&8[&8]```.
Also, except from _ping-placeholder_, every other is clickable and will open up a GUI with specific items. If the item is a shulkerbox, the player can view its contents by clicking on it.
### PlayerMention
When typing the name of a player in a certain format (specified in player-mention), this will be replaced with the format in player-mention-parsed.
This can only happen if the player has the permission fulmichat.mention.
Also, the specified player will receive a sound (see player-mention-sound), for a full list check [Bukkit Sound](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html).
NOTE: in previous versions of Minecraft sound worked differently. If you receive an error after setting the sound, try looking for "Minecraft %version% Spigot Sound" on Google.
### Emojis
FulmiChat provides a custom emoji system to your server.
Every emoji belongs to a group (if none is specified, default will be used), meaning that a player has access to the emojis of a group only if she/he has permission fulmichat.group.%groupname%.
The plugin looks for an emoticon in the player's message and replaces it with one of the available given emojis.
Here's an example configuration:
```yaml
# The name of the group.
default:
# The name of the emoji (irrelevant).
heart:
# The emoticons to be parsed. Can be a string or a list.
emoticon:
- '<3'
- ':heart:'
# The emoji to be used when parsing. Can be a string or a list.
emoji:
- '&a❤'
- '&b❤'
- '&c❤'
- '&d❤'
- '&e❤'
star:
emoticon: ':star:'
emoji: '&6✮'
```
Finally, even if it is not advised, the plugin provides a color chat permission: fulmichat.colored-chat.
## API
Since to work, FulmiChat replaces every chat message with a ComponentBuilder, the [AsyncPlayerChatEvent](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/AsyncPlayerChatEvent.html) will not be available to developers anymore.
Instead, it is given a FulmiChatPlayerEvent to handle this situations. Here's an example:
```java
package it.fulminazzo.testplugin;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import it.fulminazzo.fulmichat.API.FulmiChatPlayerEvent;
public class PlayerListener implements Listener {
@EventHandler
public void onPlayerChat(FulmiChatPlayerEvent event) {
event.setChatMessage(new TextComponent("Hello world"));
event.getRecipients().removeIf(r -> r.getName().equals("Fulminazzo"));
event.setCancelled(false);
}
}
```