What am I not seeing?

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

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


    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() {
    public void run() {
    Player p = Bukkit.getServer().getPlayer("InsertedMyNameHere");
    p.kickPlayer("You have been kicked!");
    Bukkit.getServer().getPluginManager().callEvent(new EnforcerEvent(p, Type.KICK));

    }}, 0L, 20L);

    return false;

  2. Offline


    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


    You never specify what command to look for.
  4. Offline


    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


Thread Status:
Not open for further replies.

Share This Page