Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.TheLazeboy.Staves;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.Action;
- import org.bukkit.event.player.PlayerInteractEvent;
- public class MyPlayerListener implements Listener{
- public static Staves plugin;
- @EventHandler
- public void onPlayerInteractBlock(PlayerInteractEvent evt){
- Player player = evt.getPlayer();
- Location locd = (Location) player.getTargetBlock(null, 10);
- if(evt.getPlayer().getItemInHand().getType() == Material.STICK){
- if (evt.getAction() == Action.RIGHT_CLICK_BLOCK || evt.getAction() == Action.RIGHT_CLICK_AIR) {
- player.getWorld().strikeLightning(locd);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement