Help Plugin wont run /heal

Discussion in 'Plugin Development' started by HumanMan, Mar 15, 2011.

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

    HumanMan

    hi,
    thanks for reading, i need help, my plugin shows no errors in eclipse but receives run-time errors on server start

    Heal.java
    -> http://pastebin.com/1A4Yr5nT

    HealPlayerListener.java
    -> http://pastebin.com/fTmjgVFd

    here is my top level error:
    -> org.bukkit.plugin.InvalidPluginException
    -> at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:113)
    -> more: http://pastebin.com/hYb7BdwG

    im shure its just a syntax thing or somthing right under my nose:)
    any help apreciated

    -James
     
  2. Offline

    MadMonkeyCo

    First of all you shouldn't be using *.bukkit.* as a package name.
    Your problem has a simple solution. You need to add a .Heal to your plugin.yml.
    Code:
    main: com.bukkit.JamesWP.Heal.Heal
    I used com.bukkit just to make it clear what I was referring to.
     
  3. Offline

    HumanMan

    thanks Monkey it worked but now the command wont fire :(
    i try /help in the chat and the console logs HumanMan tried help...
    ive tried both with /help and just help in the playerListener.

    -James
     
  4. Offline

    MadMonkeyCo

    I do not know what you are trying to do. Can you post your playerListener, the problem probably lies there.
     
  5. Offline

    HumanMan

  6. Offline

    Edward Hand

    onPlayerCommand no longer exists.

    You need to use the function:
    Code:
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
    {
    
    }
    which goes in your main plugin class (Heal.java)

    You also need to register the command at the end of your plugin.yml like this:
    Code:
    commands:
      heal:
        description: Heals players or something
        usage:
     
  7. Offline

    HumanMan

    thanks will try this and get back to you

    p.s. does this mean i dont need the event regestration?

    Code:
    PluginManager pm = getServer().getPluginManager();
    
    pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, this.playerListener, Event.Priority.Normal, this);
    
    do i need to replace this with anything?

    -James

    Ok guys it works now thanks for your help you can lock this topic

    -James

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

Share This Page