Minecraft PC IP: play.cubecraft.net

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,888
248
Screenshots are not working, probably because the website has CloudFlare protection.
 
Members Online

Team online

Members online

Latest posts

Latest profile posts

LorilambtheWcubecraftian wrote on Hqteful's profile.
Thanks for all ur help as mod! Enjoy your ccg retirement!! 💛
Kazwa wrote on Hqteful's profile.
Thanks for everything!
iTz1Hamood wrote on Hqteful's profile.
Thanks for everything, Mika. It honestly won’t be the same without you. I’m wishing you all the best in whatever comes next!! You truly deserve all the good things in life 🤍 I’ll always be grateful to you. You accepted my helper app, got me here.. and that meant alooot for me. Will miss you so much!! You’ve had such a positive impact on so many of us. Take care and stay amazing 💙
llvqs wrote on Hqteful's profile.
Thanks for everything and good luck with everything! 💙🧡
Verbramdt wrote on Hqteful's profile.
Thank you for everything you've done! You'll be missed :c
Best of luck with everything that'll come in the future!
Top Bottom