Skip to content

Instantly share code, notes, and snippets.

@CyberFlameGO
Created November 18, 2021 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyberFlameGO/6d169c36248f21077d3f9391aafa1cdf to your computer and use it in GitHub Desktop.
Save CyberFlameGO/6d169c36248f21077d3f9391aafa1cdf to your computer and use it in GitHub Desktop.
this is a small snippet for running sync code asynchronously (just a task in an async scheduler)
Bukkit.getScheduler().runTaskTimerAsynchronously(LumberHarvester.getInstance(), () -> {
Bukkit.getScheduler().runTask(VoidFlame.getPlugin(), () -> {
World world = Bukkit.getWorld("world");
world.spawnEntity(new Location(world, 0, 100, 0), EntityType.PRIMED_TNT);
});
}, 0L, 20L);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment