ModsJava
AntiSwear + [SourceCode]
Java mod listed for Minecraft 1.8. Downloads from the MC Java Mods app on Android.
⬇ Download on Spigot This is a Simple Anti-Swearing Plugin.
Commands:
/antiswear - Main command
/as - Same as /antiswear
/as help - Show help page
/as addword - Add a word to the blacklist
/as removeword - remove a word from the blacklist
/as list - Show all Blacklisted words
/as reload - reload the config.
Permissions:
There is 1 permission to use every command:
antiswear.admin
To Do:
Add SpamProtection
Add Anti ip's and websites
Add ignore permission
Add AntiCaps
Add Your Suggestions
SourceCode
Commands:
/antiswear - Main command
/as - Same as /antiswear
/as help - Show help page
/as addword - Add a word to the blacklist
/as removeword - remove a word from the blacklist
/as list - Show all Blacklisted words
/as reload - reload the config.
Permissions:
There is 1 permission to use every command:
antiswear.admin
To Do:
Add SpamProtection
Add Anti ip's and websites
Add ignore permission
Add AntiCaps
Add Your Suggestions
SpeedCode
SourceCode
Code (Text):
public class Main extends JavaPlugin implements Listener {
public List<String> falsewords;
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
saveDefaultConfig();
this.falsewords = getConfig().getStringList("badwords");
}
@EventHandler
public void AntiCurse(AsyncPlayerChatEvent e)
{
Player p = e.getPlayer();
List<String> msg = Arrays.asList(e.getMessage().toLowerCase().split(" "));
for (String cens : this.falsewords) {
if (msg.contains(cens.toLowerCase()))
{
e.setCancelled(true);
p.getPlayer().chat(getConfig().getString("Message").replaceAll("&", "§"));
}
}
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player p = (Player) sender;
if ((cmd.getName().equalsIgnoreCase("AntiSwear"))) {
if (!(p.hasPermission("antiswear.admin"))) {
p.sendMessage("§cSorry, You don't Have Permissions.");
} else {
if (args.length == 0) {
p.sendMessage("§cAntiSwear");
p.sendMessage("");
p.sendMessage("§cAuthor: §rFeatherDev");
p.sendMessage("§cVersion: §r1.0");
p.sendMessage("");
p.sendMessage("§cUse: §r/AntiSwear help");
p.sendMessage("");
p.sendMessage("§cAntiSwear");
return true;
}
if (args[0].equalsIgnoreCase("help")) {
p.sendMessage("§cAntiSwear");
p.sendMessage("");
p.sendMessage("§r/AntiSwear addword");
p.sendMessage("§r/AntiSwear removeword");
p.sendMessage("§r/AntiSwear list");
p.sendMessage("§r/AntiSwear reload");
p.sendMessage("");
p.sendMessage("§cAntiSwear");
return true;
}
if (args[0].equalsIgnoreCase("addword")) {
if (!(args.length == 2)) {
p.sendMessage("§cUse: §r/as addword <word>");
return false;
}
if (this.falsewords.contains(args[1].toLowerCase())) {
p.sendMessage("§cIs Already in BlackList!");
}
if (!this.falsewords.contains(args[1].toLowerCase()))
{
this.falsewords.add(args[1].toLowerCase());
getConfig().set("badwords", this.falsewords);
p.sendMessage("§aWord: §f" + args[1] + " §aAdded to The blacklist!");
saveConfig();
}
}
if (args[0].equalsIgnoreCase("removeword")) {
if (!(args.length == 2)) {
p.sendMessage("§cUse: §r/as removeword <word>");
return false;
}
if (!this.falsewords.contains(args[1].toLowerCase())) {
p.sendMessage("§cIs Not in BlackList!");
}
if (this.falsewords.contains(args[1].toLowerCase()))
{
this.falsewords.remove(args[1].toLowerCase());
getConfig().set("badwords", this.falsewords);
p.sendMessage("§aWord: §f" + args[1] + " §aRemoved from The blacklist!");
saveConfig();
}
}
if (args[0].equalsIgnoreCase("list")) {
sender.sendMessage("§aBadWords: §7" + getConfig().getStringList("badwords").toString());
}
if (args[0].equalsIgnoreCase("reload")) {
sender.sendMessage("§aConfig Has Been Reloaded!");
reloadConfig();
}
}
}
return false;
}
}
public List<String> falsewords;
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
saveDefaultConfig();
this.falsewords = getConfig().getStringList("badwords");
}
@EventHandler
public void AntiCurse(AsyncPlayerChatEvent e)
{
Player p = e.getPlayer();
List<String> msg = Arrays.asList(e.getMessage().toLowerCase().split(" "));
for (String cens : this.falsewords) {
if (msg.contains(cens.toLowerCase()))
{
e.setCancelled(true);
p.getPlayer().chat(getConfig().getString("Message").replaceAll("&", "§"));
}
}
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player p = (Player) sender;
if ((cmd.getName().equalsIgnoreCase("AntiSwear"))) {
if (!(p.hasPermission("antiswear.admin"))) {
p.sendMessage("§cSorry, You don't Have Permissions.");
} else {
if (args.length == 0) {
p.sendMessage("§cAntiSwear");
p.sendMessage("");
p.sendMessage("§cAuthor: §rFeatherDev");
p.sendMessage("§cVersion: §r1.0");
p.sendMessage("");
p.sendMessage("§cUse: §r/AntiSwear help");
p.sendMessage("");
p.sendMessage("§cAntiSwear");
return true;
}
if (args[0].equalsIgnoreCase("help")) {
p.sendMessage("§cAntiSwear");
p.sendMessage("");
p.sendMessage("§r/AntiSwear addword");
p.sendMessage("§r/AntiSwear removeword");
p.sendMessage("§r/AntiSwear list");
p.sendMessage("§r/AntiSwear reload");
p.sendMessage("");
p.sendMessage("§cAntiSwear");
return true;
}
if (args[0].equalsIgnoreCase("addword")) {
if (!(args.length == 2)) {
p.sendMessage("§cUse: §r/as addword <word>");
return false;
}
if (this.falsewords.contains(args[1].toLowerCase())) {
p.sendMessage("§cIs Already in BlackList!");
}
if (!this.falsewords.contains(args[1].toLowerCase()))
{
this.falsewords.add(args[1].toLowerCase());
getConfig().set("badwords", this.falsewords);
p.sendMessage("§aWord: §f" + args[1] + " §aAdded to The blacklist!");
saveConfig();
}
}
if (args[0].equalsIgnoreCase("removeword")) {
if (!(args.length == 2)) {
p.sendMessage("§cUse: §r/as removeword <word>");
return false;
}
if (!this.falsewords.contains(args[1].toLowerCase())) {
p.sendMessage("§cIs Not in BlackList!");
}
if (this.falsewords.contains(args[1].toLowerCase()))
{
this.falsewords.remove(args[1].toLowerCase());
getConfig().set("badwords", this.falsewords);
p.sendMessage("§aWord: §f" + args[1] + " §aRemoved from The blacklist!");
saveConfig();
}
}
if (args[0].equalsIgnoreCase("list")) {
sender.sendMessage("§aBadWords: §7" + getConfig().getStringList("badwords").toString());
}
if (args[0].equalsIgnoreCase("reload")) {
sender.sendMessage("§aConfig Has Been Reloaded!");
reloadConfig();
}
}
}
return false;
}
}
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.8
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
AntiSwear + [SourceCode] is a free Minecraft Java mod. Compatible with Minecraft 1.8. Downloaded 209 times (via Spigot). Download it and open it directly in the game.