What am I not seeing?

Discussion in 'Plugin Development' started by ForbiddenGaming, Mar 3, 2016.

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

    ForbiddenGaming

    I do not think the scheduler is even running, am I missing anything?

    public class KickClock extends JavaPlugin{
    public final Logger logger = Logger.getLogger("Minecraft");
    public void onEnable() {

    }
    public void onDisable() {

    }
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
    Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    @Override
    public void run() {
    Player p = Bukkit.getServer().getPlayer("InsertedMyNameHere");
    p.kickPlayer("You have been kicked!");
    Bukkit.getServer().getPluginManager().callEvent(new EnforcerEvent(p, Type.KICK));
    p.sendMessage("Test");

    }}, 0L, 20L);



    return false;

    }}
     
  2. Offline

    webbhead

    Well obviously you just made the onCommand method then put a loop inside of it :/, nothing is firing it, you need to put a command in.
     
  3. Offline

    AppleBabies

    You never specify what command to look for.
    Code:
    if(cmd.getName().equals("kickclock")){
    //Stuff.
    }
     
  4. Offline

    teej107

    That doesn't really apply to the OPs problem. That only prevents certain commands from doing things that you don't want to run.

    @ForbiddenGaming Define a command in your plugin.yml and then simply execute it.
     
  5. Offline

    AppleBabies

Thread Status:
Not open for further replies.

Share This Page