guys i really don t get it i tryied everything i don t no what code to use to automaticly send commands to run.bat i was trying to do System.out.print("Save-all") and define the program as run.bat but somewone told me i was doing it wrong plz help me learn the code to autp sned commands to run.bat Thanks -Crowdy199(9)
Code:java Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() { public void run() { Bukkit.getServer().dispatchCommand(getServer().getConsoleSender(), "save-all"); }}, 4800L); Where plugin is your reference to your plugin's main class.
so this is my plugin is this right ?? package me.Crowdy199.AutoSave; import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; public class AutoSave extends JavaPlugin { Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() { public void run() { Bukkit.getServer().dispatchCommand(getServer().getConsoleSender(), "Save-All"); } }, 4800L); }
Code:java public class AutoSave extends JavaPlugin { public void onEnable(){ Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { public void run() { Bukkit.getServer().dispatchCommand(getServer().getConsoleSender(), "Save-All"); } }, 4800L); } public void onDisable(){ }}
is this rite for plugin.yml name: AutoSave main: me.Crowdy199.AutoSave.AutoSave version: 1.0 author: Crowdy199 description: Provides automatic world saves at defined commands: autosave: description: Saves the world. aliases: save