Minecraft PC IP: play.cubecraft.net
  • We're running an internal migration of all old players' stats to our new highly advanced statistics tracking backend. This means that stat changes will be a bit delayed while we ingest this huge backlog of data. Nothing is being lost, it'll just take a bit longer to show up in the in-game UIs.

DrHam

Forum Veteran
Sep 15, 2015
3,615
4,166
518
Kepler-452b
Hello people, the awesome plugin not really that recently has flooded the Plugins/Codes section is here! no one is hypped ikr


-FEATURES
  • Sentences filter: Cancel some messages.
  • Word replacer: Replace curse words for other words.
  • Broadcaster (With & Without using the config file)
  • Custom welcome messages!
-COMMANDS
  • /bc + text, broadcast a message
  • /ChatEssentials displays an awesome thing!

-VIDEO(S)


PS: I would like to get feedback and also bug reports!!!



SOURCE CODE


Code:
package chat.essentials;


import java.util.List;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin implements Listener {

    public final Logger logger = Logger.getLogger("Minecraft");

    public static String chatcolor(String s){
        return ChatColor.translateAlternateColorCodes('&', s);
        }
    @EventHandler(priority=EventPriority.HIGHEST)
    public void handleJoin(PlayerJoinEvent event)
    {
        Player p = event.getPlayer();
        event.setJoinMessage(chatcolor(getConfig().getString("WelcomeMessage")));
  
    }

    List<String> blockedMessages = getConfig().getStringList("Blacklist");

    @EventHandler
    public void playerChatEvent(AsyncPlayerChatEvent event) {

    for (String blockedMessage : blockedMessages) {
    if(event.getMessage().contains(blockedMessage)) {
    event.setCancelled(true);
    event.getPlayer().sendMessage("" + ChatColor.RED + ChatColor.BOLD + "You're not allowed to say this. Bypassing the filter  may result in a mute." );
    return;
    }
    }
    }  
    public void onEnable()
    {
        getServer().getPluginManager().registerEvents(this, this);
        getConfig().options().copyDefaults(true);
        saveConfig();
    }

    public void onDisable()
    {
    }

    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {

        Player player = (Player)sender;
       if (cmd.getName().equalsIgnoreCase("bc"))
            if (player.hasPermission("CE.Broadcast")) {
            int laengeArray = args.length;
            int indexArray = 0;
            String text = "";
            for (int i = 0; i < args.length; i++) {
                text = text + args[i] + " ";
            }
            Bukkit.broadcastMessage(ChatColor.DARK_RED + "[Alert] " + ChatColor.RED + text);
        return true;
       }

    if (cmd.getName().equalsIgnoreCase("ChatEssentials")) {
        player.sendMessage(ChatColor.DARK_BLUE + "----------------------------------------");
        player.sendMessage(ChatColor.BLUE + "ChatEssentials v2 by Hangar555");

        player.sendMessage(ChatColor.GREEN + "Commands:");
        player.sendMessage(ChatColor.DARK_GREEN + "/ChatEssentials" + ChatColor.GOLD + ":" + ChatColor.GREEN + "Displays this message");
        player.sendMessage(ChatColor.DARK_GREEN + "/Broadcast" + ChatColor.GOLD + ":" + ChatColor.GREEN + "Broadcast the message written inconfig.yml!");
        player.sendMessage(ChatColor.GREEN + "Info:");
        player.sendMessage(ChatColor.DARK_GREEN + "This plugin is able to edit player messages, to prevent curse words");
        player.sendMessage(ChatColor.DARK_GREEN + "It can also intercept heavy messages");
        player.sendMessage(ChatColor.DARK_GREEN + "You are not allowed to edit and/or copy the plugin without the developer permission");
        player.sendMessage(ChatColor.DARK_BLUE + "----------------------------------------");


    return true;
}
    return false;
}
}



for some reason images weren't displayed




SPIGOT: https://www.spigotmc.org/resources/chatessentials.26203/
 

Anmazing

Dedicated Member
Aug 7, 2014
1,429
1,880
248
Screenshots are not working, probably because the website has CloudFlare protection.
 
Members Online

Team online

Latest profile posts

Quewds wrote on Noodles.'s profile.
Found you 🌹
kevin020007 wrote on B4CKROOMS's profile.
Thanks for the follow!
HOTROD the 6th wrote on Daanfkyy's profile.
Congrats on bedrock helper, hope you succeed!
ItzJuan wrote on Marta's profile.
🫡 Thank you for all the hard work you've done. We'll never forget you.
HelmutRebew wrote on Alexp192's profile.
Thanks for the follow!
Top Bottom