Guest User

PlayerTrackerPlus API Example

a guest
Jul 31st, 2014
1,267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// BUKKIT PLUGIN :
  2. /// http://dev.bukkit.org/bukkit-plugins/playertrackerplus/
  3. /// EXAMPLE
  4.  
  5.     public class TestClass extends JavaPlugin{
  6.  
  7.         TrackerAPI api = new TrackerAPI();
  8.  
  9.         public boolean onCommand(CommandSender sender,Command cmd, String cmdlabel, String[] args) {
  10.  
  11.         if(cmd.getName().equalsIgnoreCase("near")) {
  12.  
  13.         api.TrackNearestPlayer(p);
  14.  
  15.         }
  16.  
  17.         if(cmd.getName().equalsIgnoreCase("random")) {
  18.  
  19.         int random = new Random().nextInt(Bukkit.getOnlinePlayers().length);
  20.         Player randomPlayer = Bukkit.getOnlinePlayers()[random];
  21.  
  22.         api.TrackPlayer(p, randomPlayer);
  23.  
  24.  
  25.         }
  26.  
  27.         }
  28.         return true;
  29.         }
Advertisement
Add Comment
Please, Sign In to add comment