Solved Event Help

Discussion in 'Spigot Plugin Development' started by YoloSanta, Jun 10, 2017.

  1. Hey guys I need help when I was coding this, I ran into an error I get this error when I put this code into the class
    Code (Text):;
    Send some help? Or tell me what to add here to fix it.

  2. Can you post the error please?
  3. What is your error (Send the whole error)

    EDIT: xD @Jobsms and I send a message at the same time...
  4. All it says is "e cannot be resolved"

    Im getting the mc error right now...
  5. Oh...

    What Event is it?
  6. @YoloSanta I got it!, You are using
    Code (Text):
    in a Command

    Code (Text):;
    You have this:
    Code (Text):
    Player player = (Player) sender;
    That gets the player from sender

    e.getPlayer() is only for events
  7. @Steve.Rock @Jobsms Heres the error log
    Code (Text):
    [12:32:59] [Server thread/INFO]: snidfnjsdnf issued server command: /gm
    [12:32:59] [Server thread/ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'gm' in plugin MenuInv v1.0
        at org.bukkit.command.PluginCommand.execute( ~[craftbukkit.jar:git-Bukkit-6e3cec8]
        at org.bukkit.command.SimpleCommandMap.dispatch( ~[craftbukkit.jar:git-Bukkit-6e3cec8]
        at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand( ~[craftbukkit.jar:git-Bukkit-6e3cec8]
        at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand( [craftbukkit.jar:git-Bukkit-6e3cec8]
        at net.minecraft.server.v1_11_R1.PlayerConnection.a( [craftbukkit.jar:git-Bukkit-6e3cec8]
        at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(SourceFile:37) [craftbukkit.jar:git-Bukkit-6e3cec8]
        at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(SourceFile:9) [craftbukkit.jar:git-Bukkit-6e3cec8]
        at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$ [craftbukkit.jar:git-Bukkit-6e3cec8]
        at java.util.concurrent.Executors$ Source) [?:1.8.0_121]
        at Source) [?:1.8.0_121]
        at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [craftbukkit.jar:git-Bukkit-6e3cec8]
        at net.minecraft.server.v1_11_R1.MinecraftServer.D( [craftbukkit.jar:git-Bukkit-6e3cec8]
        at net.minecraft.server.v1_11_R1.DedicatedServer.D( [craftbukkit.jar:git-Bukkit-6e3cec8]
        at net.minecraft.server.v1_11_R1.MinecraftServer.C( [craftbukkit.jar:git-Bukkit-6e3cec8]
        at [craftbukkit.jar:git-Bukkit-6e3cec8]
        at Source) [?:1.8.0_121]
    Caused by: java.lang.Error: Unresolved compilation problem:
        e cannot be resolved

        at me.imanthe.plugins.gamemodegui.MenuInv.onCommand( ~[?:?]
        at org.bukkit.command.PluginCommand.execute( ~[craftbukkit.jar:git-Bukkit-6e3cec8]
        ... 15 more
    [12:33:03] [Server thread/INFO]: Stopping the server
    [12:33:03] [Server thread/INFO]: Stopping server
    [12:33:03] [Server thread/INFO]: [MenuInv] Disabling MenuInv v1.0
    So how would I be able to fix it?

    Testing your way @Steve.Rock
  8. Change
    Code (Text):;
    Code (Text):;
    In The Main Command class
  9. Thanks for the help, Here is the fix for people in the future looking for help.
    • Agree Agree x 1