Error in Console

Discussion in 'Plugin Development' started by ShredNyx, Nov 29, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    ShredNyx

    18:42:45 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'fun'
    in plugin Test v1
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:19
    2)
    at org.bukkit.craftbukkit.v1_6_R3.CraftServer.dispatchCommand(CraftServe
    r.java:528)
    at net.minecraft.server.v1_6_R3.PlayerConnection.handleCommand(PlayerCon
    nection.java:968)
    at net.minecraft.server.v1_6_R3.PlayerConnection.chat(PlayerConnection.j
    ava:886)
    at net.minecraft.server.v1_6_R3.PlayerConnection.a(PlayerConnection.java
    :837)
    at net.minecraft.server.v1_6_R3.Packet3Chat.handle(SourceFile:49)
    at net.minecraft.server.v1_6_R3.NetworkManager.b(NetworkManager.java:296
    )
    at net.minecraft.server.v1_6_R3.PlayerConnection.e(PlayerConnection.java
    :116)
    at net.minecraft.server.v1_6_R3.ServerConnection.b(SourceFile:37)
    at net.minecraft.server.v1_6_R3.DedicatedServerConnection.b(SourceFile:3
    0)
    at net.minecraft.server.v1_6_R3.MinecraftServer.t(MinecraftServer.java:5
    92)
    at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:2
    27)
    at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:4
    88)
    at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java
    :421)
    at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:5
    83)
    Caused by: java.lang.NullPointerException
    at me.shrednyx.Test.Main.spawnZombie(Main.java:201)
    at me.shrednyx.Test.Main.onCommand(Main.java:88)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
    ... 15 more

    Anyone know what line is the error? And i cant find what the console cant reahc
     
  2. Offline

    pope_on_dope

    line 201 in your main class is throwing a null pointer
     
  3. Offline

    ShredNyx

    Zombie z1 = (Zombie) p.getWorld().spawnEntity(p.getLocation(), EntityType.ZOMBIE);{
    pope_on_dope
     
  4. Offline

    Skye

  5. Offline

    sgtcaze

    You could use
    Code:java
    1. CraftZombie z = (CraftZombie) p.getLocation().getWorld()
    2. .spawn(p.getLocation(), Zombie.class);
     
    ShredNyx likes this.
  6. Offline

    ShredNyx

    Lol caze sgtcaze i watch ur vids broski there sick keep up the good work and thx

    And still same error sgtcaze

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
    sgtcaze likes this.
  7. Offline

    sgtcaze

    What line? And the code on that line? What is the error?

    Here's the code I used (no errors here):
    http://pastebin.com/XSh55Apy
     
  8. Offline

    xTrollxDudex

    sgtcaze
    What? You really don't need to cast to craft zombie...
    ShredNyx
    What are you doing with the zombie?
     
  9. Offline

    sgtcaze

    My mistake. Old habits die hard.
     
  10. Offline

    ShredNyx

    nvm i didnt define p right? Whens ur next vid sgtcaze
     
Thread Status:
Not open for further replies.

Share This Page