Advertisement
Guest User

Untitled

a guest
Jun 5th, 2013
44
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.TheLazeboy.Staves;
  2.  
  3. import org.bukkit.Location;
  4. import org.bukkit.Material;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.event.EventHandler;
  7. import org.bukkit.event.Listener;
  8. import org.bukkit.event.block.Action;
  9. import org.bukkit.event.player.PlayerInteractEvent;
  10.  
  11. public class MyPlayerListener implements Listener{
  12.     public static Staves plugin;
  13.    
  14.     public MyPlayerListener(Staves staves) {
  15.         // TODO Auto-generated constructor stub
  16.        
  17.     }
  18.  
  19.     public static Staves plugin;
  20.  
  21.     public void mp(Staves instance){
  22.     plugin = instance;
  23.     }
  24.     public void Enable(boolean b) {
  25.     // TODO Auto-generated method stub
  26.     }
  27.    
  28.     @EventHandler
  29.     public void onPlayerInteractBlock(PlayerInteractEvent evt){
  30. Player player = evt.getPlayer();
  31. Location locd = (Location) player.getTargetBlock(null, 10);
  32.         if(evt.getPlayer().getItemInHand().getType() == Material.STICK){
  33.              if (evt.getAction() == Action.RIGHT_CLICK_BLOCK || evt.getAction() == Action.RIGHT_CLICK_AIR) {
  34.             player.getWorld().strikeLightning(locd);
  35.         }
  36.     }
  37. }
  38. }
Advertisement
RAW Paste Data Copied
Advertisement