Solved Anti Spam Bot

Discussion in 'Plugin Development' started by AKS JEFFREY, Apr 27, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    AKS JEFFREY

    So i need help (The Source code) for an anti spam bot. For example if player says 3 thing in X second they get muted (1 Min with a config file) then later kick (25Min With a config file) and then well IP ban not player ban IP.
     
  2. Offline

    mrkirby153

    AKS JEFFREY

    This belongs in the Plugin Requests section
     
  3. Offline

    AKS JEFFREY

    mrkirby153 No No i want to make the plugin I NEED THE CODE (Just pointing out not sreaming lola)
     
  4. Offline

    TGRHavoc

    AKS JEFFREY
    I don't think many people appreciate you trying to be "spoon-feed" code. Learn how to make it through tutorials or other media. Then, and only then, come back if you have a problem that you cannot complete yourself.
     
    AKS JEFFREY and mrkirby153 like this.
  5. Offline

    mrkirby153

    AKS JEFFREY


    You are welcome to put in your plugin request that you would like a copy of the code when the plugin is finished. The Plugin Development section is mainly for people who need help developing a plugin and are willing to put in the majority of the work for them. The Plugin Requests subforum is more designed for people who want a plugin but do not want to code it themselves. Correct me if I'm wrong.
     
    TGRHavoc likes this.
  6. Offline

    AKS JEFFREY

    TGRHavoc i've been looking for about 3-4 days on how to do this and well most of the time i when i would test out the code on my sever and it didn't work. I like it when some one would give me the code and explain it e.g
    Code:java
    1. public void onEnable(){
    2. //Any code under this will work when the server get started
    3.  


    mrkirby153 If i was to put this in the Plugin Request I can't post that .jar on dev.bukkit cause i didn't code it but the problem here is i don't know the code i would write vs i want some one else to code it for me

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  7. Offline

    TGRHavoc

    AKS JEFFREY
    Ok.. Did you try using the AsyncPlayerChatEvent?
    Code:java
    1. public void chatEvent(AsyncPlayerChatEvent e){
    2. //This will be called when a player talks in chat
    3. }
     
  8. Offline

    AKS JEFFREY

    Umm i was looking at one guys code it was this
    Code:java
    1. package com.weebly.aksjeffreydonation;
    2.  
    3. import java.util.ArrayList;
    4. import java.util.Arrays;
    5. import java.util.Date;
    6. import java.util.HashMap;
    7. import java.util.Random;
    8.  
    9. import org.bukkit.Bukkit;
    10. import org.bukkit.ChatColor;
    11. import org.bukkit.entity.Player;
    12. import org.bukkit.event.EventHandler;
    13. import org.bukkit.event.EventPriority;
    14. import org.bukkit.event.Listener;
    15. import org.bukkit.event.player.AsyncPlayerChatEvent;
    16. import org.bukkit.event.player.PlayerChatEvent;
    17. import org.bukkit.event.player.PlayerCommandPreprocessEvent;
    18. import org.bukkit.event.player.PlayerJoinEvent;
    19. import org.bukkit.event.player.PlayerMoveEvent;
    20. import org.bukkit.event.player.PlayerPreLoginEvent;
    21. import org.bukkit.event.player.PlayerPreLoginEvent.Result;
    22. import org.bukkit.event.player.PlayerQuitEvent;
    23. import org.bukkit.plugin.PluginManager;
    24. import org.bukkit.plugin.java.JavaPlugin;
    25.  
    26. @SuppressWarnings({ "deprecation", "unused" })
    27. public class MainClass extends JavaPlugin implements Listener{
    28.  
    29. Player player;
    30. private long time;
    31. private int basePlayers;
    32. private boolean blockNoMoved = false;
    33. private int norejointime;
    34. // private int add;
    35. private HashMap<String, PlayerDataHolder>data = new HashMap<String, PlayerDataHolder>();
    36. private boolean blockDupe = false;
    37. private boolean blockDupeCommands = false;
    38. private long lasttick = new Date().getTime();
    39. private long totaltime =0;
    40. private long tickno = 1;
    41.  
    42.  
    43. public void onEnable(){
    44. getLogger().info("ChatBot Has Started!");
    45. getLogger().info("ChatBot01 Has Joined The Game!");
    46. getLogger().info("ChatBot02 Has Joined The Game!");
    47. getLogger().info("ChatBot03 Has Joined The Game!");
    48. player.sendMessage("ChatBot01 Has Joined The Game!");
    49. player.sendMessage("ChatBot02 Has Joined The Game!");
    50. player.sendMessage("ChatBot03 Has Joined The Game!");
    51. getLogger().info("Saving The World and player Data");
    52. getConfig().options().copyDefaults(true);
    53. this.saveDefaultConfig();
    54. basePlayers = getConfig().getInt("min-players");
    55. time = getConfig().getLong("delay");
    56. //add = getconfig().getLong("")
    57. blockDupe = getConfig().getBoolean("Block-Dupe-Messages");
    58. blockDupeCommands = getConfig().getBoolean("Block-Dupe-Commands");
    59. blockNoMoved = getConfig().getBoolean("Block-Until-Moved");
    60. norejointime = getConfig().getInt("Rejoin-time");
    61.  
    62. for(Player p: this.getServer().getOnlinePlayers()){
    63. data.put(p.getName(),new PlayerDataHolder());
    64. }
    65.  
    66. this.getServer().getPluginManager().registerEvents(this, this);
    67.  
    68.  
    69.  
    70.  
    71.  
    72. }
    73.  
    74. @EventHandler(priority = EventPriority.HIGHEST)
    75. public void JoinEvent(PlayerJoinEvent e){
    76. data.put(e.getPlayer().getName(), new PlayerDataHolder());
    77. }
    78.  
    79. /* public void LeaveEvent(PlayerQuitEvent e){
    80. data.remove(e.getPlayer());
    81. }*/
    82.  
    83.  
    84.  
    85. //Probably should merge the PlayerChatEvent and OnCommandPreProccess Event in a later update
    86. //since the inside of each method is nearly identical.
    87.  
    88. @EventHandler(priority = EventPriority.HIGHEST)
    89. public void ChatHandler(AsyncPlayerChatEvent e){
    90.  
    91. PlayerDataHolder pdata = data.get(e.getPlayer().getName());
    92. if(!e.getPlayer().hasPermission("chatlimiter.ignore") && !e.getPlayer().isOp()){
    93. if(!data.get(e.getPlayer().getName()).moved && blockNoMoved){
    94. e.getPlayer().sendMessage(ChatColor.RED + "You must move before chatting!");
    95. e.setCancelled(true);
    96. return;
    97. }
    98. if(getServer().getOnlinePlayers().length > basePlayers){
    99. Long current = new Date().getTime();
    100. current = current / 1000;
    101. boolean blocked = false;
    102. if(current - pdata.lastMessageTime < time){
    103. e.getPlayer().sendMessage(ChatColor.RED + "You must wait "+ time +" Seconds between messages! (" + (time - (current - pdata.lastMessageTime)) + " remaining)");
    104. e.setCancelled(true);
    105. blocked = true;
    106. }
    107. else{
    108. pdata.lastMessageTime = current;
    109. }
    110. if(pdata.lastMessage.equals(e.getMessage()) && blockDupe){
    111. e.getPlayer().sendMessage(ChatColor.RED + "Cannot send duplicate messages!");
    112. e.setCancelled(true);
    113. }
    114. if(!blocked)
    115. pdata.lastMessage = e.getMessage();
    116.  
    117. }
    118. }
    119.  
    120. }
    121. @EventHandler(priority = EventPriority.HIGHEST)
    122. public void ChatHandler(PlayerCommandPreprocessEvent e){
    123. PlayerDataHolder pdata = data.get(e.getPlayer().getName());
    124. if(!e.getPlayer().hasPermission("chatlimiter.ignore") && !e.getPlayer().isOp()){
    125. if(!data.get(e.getPlayer().getName()).moved && blockNoMoved){
    126. e.getPlayer().sendMessage(ChatColor.RED + "You must move before chatting!");
    127. e.setCancelled(true);
    128. return;
    129. }
    130. if(getServer().getOnlinePlayers().length > basePlayers){
    131. Long current = new Date().getTime();
    132. current = current / 1000;
    133. boolean blocked = false;
    134. if(current - pdata.lastMessageTime < time){
    135. e.getPlayer().sendMessage(ChatColor.RED + "You must wait "+ time +" Seconds between messages! (" + (time - (current - pdata.lastMessageTime)) + " remaining)");
    136. e.setCancelled(true);
    137. blocked = true;
    138. }
    139. else{
    140. pdata.lastMessageTime = current;
    141. }
    142. if(pdata.lastMessage.equals(e.getMessage()) && blockDupeCommands){
    143. e.getPlayer().sendMessage(ChatColor.RED + "Cannot send duplicate messages!");
    144. e.setCancelled(true);
    145. }
    146. if(!blocked)
    147. pdata.lastMessage = e.getMessage();
    148.  
    149. }
    150. }
    151. }
    152.  
    153. @EventHandler(priority = EventPriority.HIGHEST)
    154. public void JoinHandler(PlayerPreLoginEvent e){
    155. PlayerDataHolder pdata = data.get(e.getName());
    156. if(pdata == null)return;
    157. Long current = new Date().getTime();
    158. current = current / 1000;
    159. if(current - pdata.lastLeave < norejointime){
    160. e.disallow(Result.KICK_OTHER, "Must wait "+(norejointime - (current - pdata.lastLeave))+" Seconds before joining");
    161.  
    162. }
    163.  
    164. data.put(e.getName(), pdata);
    165.  
    166. }
    167.  
    168.  
    169.  
    170. @EventHandler(priority = EventPriority.HIGHEST)
    171. public void LeaveHandler(PlayerQuitEvent e){
    172. if(e.getPlayer().hasPermission("chatlimiter.ignore"))return;
    173. PlayerDataHolder pdata = data.get(e.getPlayer().getName());
    174. pdata.lastLeave = new Date().getTime() / 1000;
    175. data.put(e.getPlayer().getName(), pdata);
    176. }
    177.  
    178. @EventHandler(priority = EventPriority.HIGHEST)
    179. public void MoveHandler(PlayerMoveEvent e){
    180. data.get(e.getPlayer().getName()).moved = true;
    181. }
    182.  
    183.  
    184. class PlayerDataHolder{
    185. boolean moved = false;
    186. public long lastMessageTime = 0;
    187. public String lastMessage = "";
    188. public long lastLeave = 0;
    189. }
    190.  
    191. }

    i just edited it a bit and when i tested it on my server (Kept spamming) it didn't mute/ban/kick or warned me? is the code wrong?

    EDIT: I was too lazy therefor i didn't make a config.yml
     
  9. Offline

    killerman747

    Was that just the quickest line of code that you could find to try to say that you do know how to code? Either way im not gonna sit here and bicker.
    Your going to want to make a chatlistener and get the message sent by a player, then when the play chats again check if the two messages are equal, and if they are, then do something like cancel the chat message or kick/ban the player.
     
    AKS JEFFREY likes this.
  10. Offline

    AKS JEFFREY

    killerman747 I tied that e.g. is like 2 sec so.. Do you really thing i don't know what onenable is that i have to search it up? i made a plugin before please
     
  11. Offline

    TGRHavoc

    AKS JEFFREY
    Taking someone else's code and editing it isn't cool man...
     
  12. Offline

    AKS JEFFREY

    TGRHavoc He Said "Yo Jeffrey if you want you can edit it" and i wasn't gonna steal the whole code just wanted to see if it works
     
  13. Offline

    TGRHavoc

  14. Offline

    AKS JEFFREY

    TGRHavoc i was OP and tested it and deop myself and tested it agian
    Umm remember i didn't make a config.yml file

    TGRHavoc I may have messed up on the plugin.yml wait
    Code:
    name: ChatBot
    main: com.weebly.aksjeffreydonation.MainClass
    version: 1
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  15. Offline

    TGRHavoc

    AKS JEFFREY
    Is that the package location for the main class?
     
  16. Offline

    AKS JEFFREY

    yesh TGRHavoc

    TGRHavoc Something wrong right i haven't coded for quite a while EQAO got me studying

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  17. Offline

    TGRHavoc

  18. Offline

    AKS JEFFREY

    um wait

    @TGRHavoc

    Code:
    [21:04:07] [Server thread/INFO]: Starting minecraft server version 1.7.2
    [21:04:07] [Server thread/WARN]: To start the server with more ram, launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar"
    [21:04:07] [Server thread/INFO]: Loading properties
    [21:04:07] [Server thread/INFO]: Default game type: SURVIVAL
    [21:04:07] [Server thread/INFO]: Generating keypair
    [21:04:08] [Server thread/INFO]: Starting Minecraft server on *:25565
    [21:04:08] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-1.7.2-R0.3-b3020jnks (MC: 1.7.2) (Implementing API version 1.7.2-R0.3)
    [21:04:08] [Server thread/INFO]: [ChatBot] Loading ChatBot v1
    [21:04:08] [Server thread/INFO]: Preparing level "world"
    [21:04:09] [Server thread/INFO]: Preparing start region for level 0 (Seed: 3479871944293054044)
    [21:04:09] [Thread-7/INFO]: ----- Bukkit Auto Updater -----
    [21:04:09] [Thread-7/INFO]: It appears that you're running a Beta Build, when you've specified in bukkit.yml that you prefer to run Recommended Builds.
    [21:04:09] [Thread-7/INFO]: If you would like to be kept informed about new Beta Build releases, it is recommended that you change 'preferred-channel' in your bukkit.yml to 'beta'.
    [21:04:09] [Thread-7/INFO]: With that set, you will be told whenever a new version is available for download, so that you can always keep up to date and secure with the latest fixes.
    [21:04:09] [Thread-7/INFO]: If you would like to disable this warning, simply set 'suggest-channels' to false in bukkit.yml.
    [21:04:09] [Thread-7/INFO]: ----- ------------------- -----
    [21:04:10] [Server thread/INFO]: Preparing spawn area: 27%
    [21:04:11] [Server thread/INFO]: Preparing spawn area: 47%
    [21:04:12] [Server thread/INFO]: Preparing spawn area: 66%
    [21:04:12] [Server thread/INFO]: Preparing start region for level 1 (Seed: 3479871944293054044)
    [21:04:13] [Server thread/INFO]: Preparing spawn area: 98%
    [21:04:13] [Server thread/INFO]: Preparing start region for level 2 (Seed: 3479871944293054044)
    [21:04:14] [Server thread/INFO]: [ChatBot] Enabling ChatBot v1
    [21:04:14] [Server thread/INFO]: [ChatBot] ChatBot Has Started!
    [21:04:14] [Server thread/INFO]: [ChatBot] ChatBot01 Has Joined The Game!
    [21:04:14] [Server thread/INFO]: [ChatBot] ChatBot02 Has Joined The Game!
    [21:04:14] [Server thread/INFO]: [ChatBot] ChatBot03 Has Joined The Game!
    [21:04:14] [Server thread/ERROR]: Error occurred while enabling ChatBot v1 (Is it up to date?)
    java.lang.NullPointerException
        at com.weebly.aksjeffreydonation.MainClass.onEnable(MainClass.java:48) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:250) ~[minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:350) [minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:389) [minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugin(CraftServer.java:439) [minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.enablePlugins(CraftServer.java:375) [minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.m(MinecraftServer.java:342) [minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.g(MinecraftServer.java:319) [minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.a(MinecraftServer.java:275) [minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:175) [minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:424) [minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [minecraft_server.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    [21:04:14] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [21:04:14] [Server thread/INFO]: Done (5.465s)! For help, type "help" or "?"
    [21:04:14] [Server thread/INFO]: (ip) lost connection: Disconnected
    [21:04:23] [Server thread/INFO]: Plugins (1): [0;32;1mChatBot[m
    [21:04:26] [Server thread/INFO]: [0;33;1m--------- [0;37;1mHelp: Index [0;33;1m---------------------------[m
    [21:04:26] [Server thread/INFO]: [0;37;22mUse /help [n] to get page n of help.[m
    [21:04:26] [Server thread/INFO]: [0;33;22mAliases: [0;37;1mLists command aliases[m
    [21:04:26] [Server thread/INFO]: [0;33;22mBukkit: [0;37;1mAll commands for Bukkit[m
    [21:04:26] [Server thread/INFO]: [0;33;22mMinecraft: [0;37;1mAll commands for Minecraft[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/achievement: [0;37;1mGives the specified player an achievement or changes a statistic value. Use '*' to give all achievements.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/ban: [0;37;1mPrevents the specified player from using this server[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/ban-ip: [0;37;1mPrevents the specified IP address from using this server[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/banlist: [0;37;1mView all players banned from this server[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/clear: [0;37;1mClears the player's inventory. Can specify item and data filters too.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/defaultgamemode: [0;37;1mSet the default gamemode[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/deop: [0;37;1mTakes the specified player's operator status[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/difficulty: [0;37;1mSets the game difficulty[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/effect: [0;37;1mAdds/Removes effects on players[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/enchant: [0;37;1mAdds enchantments to the item the player is currently holding. Specify 0 for the level to remove an enchantment. Specify force to ignore normal enchantment restrictions[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/gamemode: [0;37;1mChanges the player to a specific game mode[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/gamerule: [0;37;1mSets a server's game rules[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/give: [0;37;1mGives the specified player a certain amount of items[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/help: [0;37;1mShows the help menu[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/kick: [0;37;1mRemoves the specified player from the server[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/kill: [0;37;1mCommits suicide, only usable as a player[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/list: [0;37;1mLists all online players[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/me: [0;37;1mPerforms the specified action in chat[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:achievement: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:ban: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:ban-ip: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:banlist: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:clear: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:defaultgamemode: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:deop: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:difficulty: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:effect: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:enchant: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:gamemode: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:gamerule: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:give: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:help: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:kick: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:kill: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:list: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:me: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:op: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:pardon: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:pardon-ip: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:playsound: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:say: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:scoreboard: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:seed: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:setidletimeout: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:setworldspawn: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:spawnpoint: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:spreadplayers: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:tell: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:testfor: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:time: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:toggledownfall: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:tp: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:weather: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:whitelist: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/minecraft:xp: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/op: [0;37;1mGives the specified player operator status[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/pardon: [0;37;1mAllows the specified player to use this server[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/pardon-ip: [0;37;1mAllows the specified IP address to use this server[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/playsound: [0;37;1mPlays a sound to a given player[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/plugins: [0;37;1mGets a list of plugins running on the server[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/reload: [0;37;1mReloads the server configuration and plugins[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/save-all: [0;37;1mSaves the server to disk[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/save-off: [0;37;1mDisables server autosaving[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/save-on: [0;37;1mEnables server autosaving[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/say: [0;37;1mBroadcasts the given message as the sender[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/scoreboard: [0;37;1mScoreboard control[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/seed: [0;37;1mShows the world seed[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/setblock: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/setidletimeout: [0;37;1mSets the server's idle timeout[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/setworldspawn: [0;37;1mSets a worlds's spawn point. If no coordinates are specified, the player's coordinates will be used.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/spawnpoint: [0;37;1mSets a player's spawn point[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/spreadplayers: [0;37;1mSpreads players around a point[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/stop: [0;37;1mStops the server with optional reason[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/summon: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/tell: [0;37;1mSends a private message to the given player[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/tellraw: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/testfor: [0;37;1mTests whether a specifed player is online[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/testforblock: [0;37;1mA Mojang provided command.[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/time: [0;37;1mChanges the time on each world[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/timings: [0;37;1mRecords timings for all plugin events[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/toggledownfall: [0;37;1mToggles rain on/off on a given world[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/tp: [0;37;1mTeleports the given player (or yourself) to another player or coordinates[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/version: [0;37;1mGets the version of this server including any plugins in use[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/weather: [0;37;1mChanges the weather[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/whitelist: [0;37;1mManages the list of players allowed to use this server[m
    [21:04:26] [Server thread/INFO]: [0;33;22m/xp: [0;37;1mGives the specified player a certain amount of experience. Specify <amount>L to give levels instead, with a negative amount resulting in taking levels.[m
    [21:04:38] [User Authenticator #1/INFO]: UUID of player LAGxcrafter is (Stuf)
    [21:04:38] [Server thread/INFO]: LAGxcrafter[(ip)] logged in with entity (Stuff)
    [21:04:40] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2603ms behind, skipping 52 tick(s)
    [21:04:54] [Netty IO #2/INFO]: <LAGxcrafter> g[m
    [21:04:56] [Netty IO #2/INFO]: <LAGxcrafter> g[m
    [21:04:57] [Netty IO #2/INFO]: <LAGxcrafter> g[m
    [21:04:58] [Server thread/INFO]: LAGxcrafter issued server command: /
    [21:04:58] [Server thread/INFO]: LAGxcrafter issued server command: /
    [21:05:00] [Netty IO #2/INFO]: <LAGxcrafter> g[m
    [21:05:00] [Netty IO #2/INFO]: <LAGxcrafter> g[m
    [21:05:01] [Server thread/INFO]: LAGxcrafter issued server command: /gg
    [21:05:04] [Netty IO #2/INFO]: <LAGxcrafter> fggd[m
    [21:05:11] [Server thread/INFO]: CONSOLE: De-opped LAGxcrafter[m
    [21:05:14] [Netty IO #2/INFO]: <LAGxcrafter> f[m
    [21:05:16] [Netty IO #2/INFO]: <LAGxcrafter> f[m
    [21:05:16] [Netty IO #2/INFO]: <LAGxcrafter> f[m
    [21:05:17] [Netty IO #2/INFO]: <LAGxcrafter> f[m
    [21:05:18] [Netty IO #2/INFO]: <LAGxcrafter> f[m
    [21:05:18] [Netty IO #2/INFO]: <LAGxcrafter> f[m
    [21:05:19] [Netty IO #2/INFO]: <LAGxcrafter> f[m
    [21:05:21] [Netty IO #2/INFO]: <LAGxcrafter> f[m
    [21:05:40] [Server thread/INFO]: LAGxcrafter lost connection: Disconnected
    [21:05:40] [Server thread/INFO]: LAGxcrafter left the game.
    [21:05:45] [Server thread/INFO]: CONSOLE: Stopping the server..[m
    [21:05:45] [Server thread/INFO]: Stopping server
    [21:05:45] [Server thread/INFO]: [ChatBot] Disabling ChatBot v1
    [21:05:45] [Server thread/INFO]: Saving players
    [21:05:45] [Server thread/INFO]: Saving worlds
    [21:05:45] [Server thread/INFO]: Saving chunks for level 'world'/Overworld
    [21:05:46] [Server thread/INFO]: Saving chunks for level 'world_nether'/Nether
    [21:05:46] [Server thread/INFO]: Saving chunks for level 'world_the_end'/The End
    [21:05:46] [Thread-4/INFO]: Stopping server
    [21:05:46] [Thread-4/INFO]: Saving players
    [21:05:46] [Thread-4/INFO]: Saving worlds
    [21:05:46] [Thread-4/INFO]: Saving chunks for level 'world'/Overworld
    
    EDIT: never thought the /help is that long

    TGRHavoc umm...
    Code:
    [21:04:14] [Server thread/ERROR]: Error occurred while enabling ChatBot v1 (Is it up to date?)
    java.lang.NullPointerException
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  19. Offline

    mrkirby153

    AKS JEFFREY

    Player is null. There are no players on the server
     
  20. Offline

    AKS JEFFREY

    mrkirby153 i joined the server

    mrkirby153 I put all those ChatBot01 Has Joined The Game! just for fun!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  21. Offline

    mrkirby153

    AKS JEFFREY

    That method is called when the server starts. And as the server is starting, no one is online so player is null. In
    Code:java
    1. player.sendMessage("ChatBot01 Has Joined The Game!");
    2. player.sendMessage("ChatBot02 Has Joined The Game!");
    3. player.sendMessage("ChatBot03 Has Joined The Game!");
     
  22. Offline

    AKS JEFFREY

    mrkirby153 so if i was to take that (Fun :) ) code out it will work?
     
  23. Offline

    TGRHavoc

    AKS JEFFREY
    Like mrkirby153 said, the server is trying to do a bunch of stuff with a non-existent player when it is enabled, remove everything that has to do with the player in the "onEnable" method.
     
    mrkirby153 likes this.
  24. Offline

    mrkirby153

    AKS JEFFREY

    I'm not sure but there are high. Also, I really think that someone didn't code that for you. IMHO you "Borrowed" the code from another plugin (Which is a no no unless the plugin is open source). My reasoning behind this is there are a lot of completely useless methods/functions for what you are trying to accomplish like the move before chatting, and the login limiter.
     
  25. Offline

    AKS JEFFREY

  26. Offline

    mrkirby153

    AKS JEFFREY

    Even so, you could rip out about 1/2 of that class
     
  27. Offline

    AKS JEFFREY

    Gonna test it out with that things @mrkirby153 TGRHavoc

    mrkirby153 Gave me this
    Code:
    [22:09:32 ERROR]: Error occurred while enabling ChatBot v1 (Is it up to date?)
    java.lang.IllegalArgumentException: The embedded resource 'config.yml' cannot be found in plugins/ChatBot Beta v1.jar
    
    So i have to make a config with what inside it?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  28. Offline

    TGRHavoc

    AKS JEFFREY
    Hmm, I wonder what you have to add to the config....
    Code:java
    1. basePlayers = getConfig().getInt("min-players");
    2. time = getConfig().getLong("delay");
    3. //add = getconfig().getLong("")
    4. blockDupe = getConfig().getBoolean("Block-Dupe-Messages");
    5. blockDupeCommands = getConfig().getBoolean("Block-Dupe-Commands");
    6. blockNoMoved = getConfig().getBoolean("Block-Until-Moved");
    7. norejointime = getConfig().getInt("Rejoin-time");
     
  29. Offline

    AKS JEFFREY

    TGRHavoc Lolz :p i just keepted looking at ur profile thx

    i don't think it looks like this umm
    Code:
    min-players:
    delay:
    Block-Dupe-Messages:
    Block-Dupe-Commands:
    Block-Until-Moved:
    Rejoin-time:
    wait the min player don't understand that is the the min players of the server?

    TGRHavoc For the rejoin time would i write 5m or the full thing

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  30. Offline

    TGRHavoc

    AKS JEFFREY
    It's an integer... So the whole thing..
     
Thread Status:
Not open for further replies.

Share This Page