I need help

Discussion in 'Plugin Development' started by Demian, Oct 27, 2014.

Thread Status:
Not open for further replies.
  1. Hi I have a plugin that works perfectly without errors made ​​but if I save a broken block with something else in my hand I get a big fat error in the console does anyone know how I can fix this?

    Code:

    Code:
    package plugin.magicalwars2.net.libs;
     
    import java.util.Arrays;
     
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.block.Block;
    import org.bukkit.enchantments.Enchantment;
    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;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.ShapedRecipe;
    import org.bukkit.inventory.meta.ItemMeta;
     
    public class WreckingBall implements Listener {
     
    @EventHandler
    public void onClick(PlayerInteractEvent event) {
     
    Player player = event.getPlayer();
    Block block = event.getClickedBlock();
     
    if(event.getAction() != Action.LEFT_CLICK_BLOCK) {
     
    return;
     
    }
     
    if(player.getItemInHand() == null) {
     
    return;
    }
     
    if(block.getLocation().getY() <= 45.0D) {
     
    return;
    }
     
    if(!player.hasPermission("magicalwars.customitem.wreckingball")) {
     
    player.sendMessage(ChatColor.RED + "Alleen koningen en hertogen kunnen een 'Wrecking Ball' gebruiken!");
    return;
    }
     
    if((event.getAction() == Action.LEFT_CLICK_BLOCK) && player.getItemInHand().getItemMeta().getDisplayName().equalsIgnoreCase("Wrecking Ball") && !(block.getLocation().getY() <= 45.0D)
    && (player.hasPermission("magicalwars.customitem.wreckingball"))) {
     
      block.breakNaturally();
     
    }
    }
     
    public static ItemStack wreckingball = new ItemStack(Material.FIREWORK_CHARGE);
     
    static {
     
    ItemMeta wreckingballmeta = wreckingball.getItemMeta();
     
    wreckingballmeta.setDisplayName("Wrecking Ball");
    wreckingballmeta.setLore(Arrays.asList(ChatColor.GOLD + "Custom item", ChatColor.GRAY + "§m                                ", ChatColor.YELLOW + "Instant wrecking blocks."));
    wreckingballmeta.addEnchant(Enchantment.DIG_SPEED, 10, true);
    wreckingball.setItemMeta(wreckingballmeta);
     
    }
     
    public static ShapedRecipe recipe = new ShapedRecipe(wreckingball);
     
    static {
     
    recipe.shape(
    " @ ",
    "@$@", 
    " @ ");
    recipe.setIngredient('@', Material.IRON_BLOCK);
    recipe.setIngredient('$', Material.NETHER_STAR);
     
    }
     
    }
    
    Code:
    28.10 13:51:15 [Server] INFO ... 15 more
    28.10 13:51:15 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_65]
    28.10 13:51:15 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_65]
    28.10 13:51:15 [Server] INFO at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source) ~[?:?]
    28.10 13:51:15 [Server] INFO at plugin.magicalwars2.net.libs.WreckingBall.onClick(WreckingBall.java:48) ~[?:?]
    28.10 13:51:15 [Server] INFO Caused by: java.lang.NullPointerException
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:186) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.PacketPlayInBlockDig.handle(PacketPlayInBlockDig.java:65) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.PacketPlayInBlockDig.a(PacketPlayInBlockDig.java:41) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:552) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at net.minecraft.server.v1_7_R4.PlayerInteractManager.dig(PlayerInteractManager.java:103) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:242) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:51:15 [Server] INFO org.bukkit.event.EventException
    28.10 13:51:15 [Server] ERROR Could not pass event PlayerInteractEvent to MagicalWars v1.0
    28.10 13:51:04 [Server] INFO [Riften] xDutchProx1: f
    28.10 13:51:04 [Server] INFO §7[§2L§7]§r xDutchProx1 f
    28.10 13:50:57 [Server] INFO Riften: xDutchProx1
    28.10 13:50:50 [Multicraft] Skipped 22 lines due to rate limit (30/s)
    28.10 13:50:34 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:34 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:34 [Server] INFO org.bukkit.event.EventException
    28.10 13:50:34 [Server] ERROR Could not pass event PlayerInteractEvent to MagicalWars v1.0
    28.10 13:50:33 [Server] INFO ... 15 more
    28.10 13:50:33 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_65]
    28.10 13:50:33 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_65]
    28.10 13:50:33 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_65]
    28.10 13:50:33 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_65]
    28.10 13:50:33 [Server] INFO at plugin.magicalwars2.net.libs.WreckingBall.onClick(WreckingBall.java:48) ~[?:?]
    28.10 13:50:33 [Server] INFO Caused by: java.lang.NullPointerException
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:186) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.PacketPlayInBlockDig.handle(PacketPlayInBlockDig.java:65) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.PacketPlayInBlockDig.a(PacketPlayInBlockDig.java:41) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:552) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at net.minecraft.server.v1_7_R4.PlayerInteractManager.dig(PlayerInteractManager.java:103) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:242) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:33 [Server] INFO org.bukkit.event.EventException
    28.10 13:50:33 [Server] ERROR Could not pass event PlayerInteractEvent to MagicalWars v1.0
    28.10 13:50:31 [Server] INFO ... 15 more
    28.10 13:50:31 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_65]
    28.10 13:50:31 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_65]
    28.10 13:50:31 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_65]
    28.10 13:50:31 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_65]
    28.10 13:50:31 [Server] INFO at plugin.magicalwars2.net.libs.WreckingBall.onClick(WreckingBall.java:48) ~[?:?]
    28.10 13:50:31 [Server] INFO Caused by: java.lang.NullPointerException
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:186) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.PacketPlayInBlockDig.handle(PacketPlayInBlockDig.java:65) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.PacketPlayInBlockDig.a(PacketPlayInBlockDig.java:41) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:552) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at net.minecraft.server.v1_7_R4.PlayerInteractManager.dig(PlayerInteractManager.java:103) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:242) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:31 [Server] INFO org.bukkit.event.EventException
    28.10 13:50:31 [Server] ERROR Could not pass event PlayerInteractEvent to MagicalWars v1.0
    28.10 13:50:29 [Server] INFO ... 15 more
    28.10 13:50:29 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_65]
    28.10 13:50:29 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_65]
    28.10 13:50:29 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_65]
    28.10 13:50:29 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_65]
    28.10 13:50:29 [Server] INFO at plugin.magicalwars2.net.libs.WreckingBall.onClick(WreckingBall.java:48) ~[?:?]
    28.10 13:50:29 [Server] INFO Caused by: java.lang.NullPointerException
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:186) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.PacketPlayInBlockDig.handle(PacketPlayInBlockDig.java:65) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.PacketPlayInBlockDig.a(PacketPlayInBlockDig.java:41) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:552) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at net.minecraft.server.v1_7_R4.PlayerInteractManager.dig(PlayerInteractManager.java:103) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:242) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:29 [Server] INFO org.bukkit.event.EventException
    28.10 13:50:29 [Server] ERROR Could not pass event PlayerInteractEvent to MagicalWars v1.0
    28.10 13:50:22 [Server] INFO ... 15 more
    28.10 13:50:22 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot-os6.jar:git-Spigot-1649]
    28.10 13:50:22 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_65]
    28.10 13:50:22 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_65]
    28.10 13:50:22 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_65]
    28.10 13:50:22 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_65]
    28.10 13:50:22 [Server] INFO at plugin.magicalwars2.net.libs.WreckingBall.onClick(WreckingBall.java:48) ~[?:?]
    28.10 13:50:22 [Server] INFO Caused by: java.lang.NullPointerException
    28.10 13:50:22 [Server] INFO at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot-os6.jar:git-Spigot-1649]
    Pleas helpe me :(
     
  2. Demian i read your post 3 times and i still cant understand what you're tring to say, because your english is so fucking bad :O
     
  3. What I'm saying is I've made ​​a plugin there are no mistakes in it just gives a weird error on the interact event the plugin works as it should only how do I fix error
     
  4. Offline

    Tss1410

    27.10 12:17:55 [Server] INFO at plugin.magicalwars2.net.libs.WreckingBall.onClick(WreckingBall.java:30) ~[?:?]
    27.10 12:17:55 [Server] INFO Caused by: java.lang.NullPointerException

    There is the line where the error is, and under is why it's giving error
     
  5. Offline

    ProtoTempus

    Demian Try to figure it out yourself first... but if you cant this is probably what's up:
    Show Spoiler

    You should be checking if getItemInHand() is not null before using it.
     
  6. Offline

    FabeGabeMC

    ProtoTempus
    This forum is for Bukkit support. For support on Spigot or other server mods, seek help somewhere else.
    ps: Sorry for annoyance but really.
     
  7. Offline

    ProtoTempus


    Who cares. I like to encourage people to learn to code. lol.

    Edit: Plus this is applicable to Bukkit.
     
  8. Offline

    tcvs

    Demian If you could edit your post and surround your code and console error in the [code ][/code ] We might be able to help as we can the easily read it.
     
    Demian likes this.

  9. What does it matter? i mean i'm asking help for my code not where my server is running on -.-

    tcvs tcvs
    OK, I did it :)

    I've patched my code to i'm now checking if the player has an item in hand, if he's isn't mining lower then y 45 and if he has the permissions but im still getting that error

    Problem solved:
    I changed if((event.getAction() == Action.LEFT_CLICK_BLOCK) && player.getItemInHand().getItemMeta().getDisplayName().equalsIgnoreCase("Wrecking Ball") && !(block.getLocation().getY() <= 45.0D)
    && (player.hasPermission("magicalwars.customitem.wreckingball"))) {
    to:
    if((event.getAction() == Action.LEFT_CLICK_BLOCK) && player.getItemInHand().hasItemMeta()) {

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
Thread Status:
Not open for further replies.

Share This Page