SHARE
TWEET

ExamplePlayerListener.Java

Adamki11s May 9th, 2011 10,393 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top