我有一個bukkit的問題。我想做一個重複的任務,發送一個消息與一個球員的座標。 謝謝你的幫助!bukkit調度器重複
Bukkit.getScheduler().scheduleAsyncRepeatingTask(this.main, new Runnable() {
@Override
public void run() {
Player tp = Bukkit.getPlayer(args[1]);
p.sendMessage("§bThe coordinates of §4" + tp.getName());
p.sendMessage("§eX: " + tp.getLocation().getBlockX());
p.sendMessage("§eY: " + tp.getLocation().getBlockY());
p.sendMessage("§eZ: " + tp.getLocation().getBlockZ());
p.sendMessage("§eD: " + tp.getLocation().getDirection());
}
}, 1, 1);
謝謝!我嘗試了一個同步任務,但它也沒有工作。我沒有使用BukkitRunnable ... –
確保將解決問題的任何答案標記爲正確的解決方案。這有助於未來的用戶與您的問題相同! – Kerooker