Last active
August 29, 2015 14:07
-
-
Save keepoff07/7cd05a6e38eacd9388d8 to your computer and use it in GitHub Desktop.
Schedulerのサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventHandler | |
public void onPlayerInteract(PlayerInteractEvent e) { | |
final Player p = e.getPlayer(); | |
ItemStack item = p.getItemInHand(); | |
if(e.getAction().equals(Action.RIGHT_CLICK_AIR)||e.getAction().equals(Action.RIGHT_CLICK_BLOCK)){ | |
if(item.getType().equals(Material.SUGAR)){ | |
Bukkit.getScheduler().runTaskLater(this, new Runnable(){ | |
public void run(){ | |
Bukkit.broadcastMessage("Delay:"+p.getName()); | |
} | |
}, 20); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment