Skip to content

Instantly share code, notes, and snippets.

@nopresnik
Created February 10, 2013 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nopresnik/4749119 to your computer and use it in GitHub Desktop.
Save nopresnik/4749119 to your computer and use it in GitHub Desktop.
this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
checkForIron();
}
}, 20L, 20L);
public void checkForIron() {
for (Player p : getServer().getOnlinePlayers()) {
if (ArmourAbilities.hasIron(p)) { //Checks if player is wearing full set of iron
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 40, 0));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment