Minecraft PC IP: play.cubecraft.net

DrHam

Forum Veteran
Sep 15, 2015
3,615
4,165
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

Latest profile posts

Casualpoalrbear wrote on PolarBear's profile.
My guy somehow haven't posted a single message or had a single reaction and is somehow a well known member 💀
BicolourSine41 wrote on finnyboy300.'s profile.
wait finny is this a new account here?
BicolourSine41 wrote on kfccaleb's profile.
congrats on novice member!
jamesthesignificant wrote on Capitan's profile.
you are cool
Top Bottom