Hello I am trying to make a plugin so when i step on een emerald block it would teleport me to the next emerald block it works but when my friend tries it it wont work for him code: Code: package me.daansander.em; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; /** * Created by Daan on 26-3-2015. */ public class Em extends JavaPlugin { public boolean toHigh = false; public void onEnable() { Bukkit.getServer().getScheduler().runTaskTimer(this, new Runnable() { @Override public void run() { for (Player p : Bukkit.getOnlinePlayers()) { Location loc = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ()); loc.add(0, -1, 0); while (!loc.getBlock().getType().equals(Material.EMERALD_BLOCK)) { return; } Location ploc = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ()); while (!ploc.getBlock().getType().equals(Material.EMERALD_BLOCK)) { double y = ploc.getY(); if(y > 100) { toHigh = true; Bukkit.broadcastMessage("Error stopping while loops"); break; } else { ploc.add(0, 1, 0); } } if(!toHigh == true) { ploc.add(0, 2, 0); p.teleport(ploc); } else { Bukkit.broadcastMessage("Error no block above"); } } } }, 0l, 0l); } /*@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if(cmd.getName().equalsIgnoreCase("em")) { if(args.length == 1) { boolean ar } } return true; }*/ } please help sorry for bad english
@DaanSander When you require that much precision, you should use the PlayerMoveEvent as @EpicCraft21 suggested.