Advertisement
Adamki11s

ExamplePlayerListener.Java

May 9th, 2011
11,456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. package me.Adamki11s.Example;
  2.  
  3. import org.bukkit.Location;
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.event.player.PlayerListener;
  6. import org.bukkit.event.player.PlayerMoveEvent;
  7.  
  8. /* Example Template
  9.  * By Adamki11s
  10.  * HUGE Plugin Tutorial
  11.  */
  12.  
  13. public class ExamplePlayerListener extends PlayerListener {
  14.    
  15.     public static Example plugin;
  16.    
  17.     public ExamplePlayerListener(Example instance) {
  18.         plugin = instance;
  19.     }
  20.  
  21.     public void onPlayerMove(PlayerMoveEvent event){
  22.        
  23.         Player player = event.getPlayer();
  24.         Location playerLoc = player.getLocation();
  25.        
  26.         player.sendMessage("Your X Coordinates : " + playerLoc.getX());
  27.         player.sendMessage("Your Y Coordinates : " + playerLoc.getY());
  28.         player.sendMessage("Your Z Coordinates : " + playerLoc.getZ());
  29.     }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement