1

KitPvP Plugin

Phaluh's Avatar Phaluh4/19/14 9:58 pm
1 emeralds 144
i am custom coding a kitpvp plugin for my server, I have the thor kit set-up but i can't seem to get it to strike lightning at what the player is looking at just at the player themselves.[code] @EventHandler
public void onPlayerInteract(PlayerInteractEvent event){
Player player = event.getPlayer();
if(event.getAction().equals(Action.RIGHT_CLICK_AIR) && player.getItemInHand().getType() == Material.STONE_AXE){
Player[] pl = event.getPlayer().getServer().getOnlinePlayers();
Vector p_vec = event.getPlayer().getLocation().toVector();
for(int i = 0; i<pl.length;i++){
if(p_vec.distance(pl[i].getLocation().toVector())<15D){
event.getPlayer().getWorld().strikeLightning(pl[i].getLocation());[/code]
that is the code now please if you know how to fix it please respond
Posted by Phaluh's Avatar
Phaluh
Level 12 : Journeyman Network
2

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome