[DEV] Could not load 'plugins/PotionProtect.jar' in folder 'plugins'

Discussion in 'Plugin Development' started by ColeBergmann, Jul 16, 2012.

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

    ColeBergmann

    Hello Developers,
    I am working on a potion protect plugin where you throw a potion, and a region gets defined for the player. The download link for my code is below. Whenever I launch the server with the plugin, it gives me this long Java error:

    http://pastebin.com/T1ibZzM4

    If there is anyone who could help me out with this issue I would be very grateful. Thank you very much for assisting me!

    Download Link for Code:
    <Edit by Moderator: Redacted mediafire url>

    Thanks again :)
     
    Last edited by a moderator: Nov 10, 2016
  2. Caused by: java.lang.ClassNotFoundException: com.CrypticPixel.PotionProtect

    You didn't define the main class.
    com.CrypticPixel.PotionProtect.PotionProtect
    Most likely.
     
  3. Offline

    ColeBergmann

    What exactly do I do to define the main class?
     
  4. In your plugin.yml, the "main:" part... add your class name at the end, it's the same name as the package so you need to have it twice, like I wrote above.

    Also, Eclipse (if you used that) should've told you that your package name is discouraged:
    It would've avoided this confusion :p
     
  5. Offline

    ColeBergmann

    Everything works perfect, but when I throw the potion it does nothing? The plugin has no errors on startup, and I can use the commands such as /protect, etc
     
  6. I dunno... debug your throwing detector event.
    Or, have you tried ProjectileLaunchEvent ?
     
  7. Offline

    ColeBergmann

    Heres the updated code/plugin combo incase you want to take a peek yourself:

    <Edit by Moderator: Redacted mediafire url>

    Is there anyone who can assist me with this? The plugin loads like normal, and it shows up in /plugins. The commands work, but when I throw a potion nothing happens. What am I doing wrong now?

    EDIT: Digi, I have tried both of those.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 10, 2016
  8. You tried debugging... really ? Debugging always yelds results. Even when it doesn't print anything it's a result because it means it doesn't trigger, so, you have a problem with the event itself triggering... and your problem is you don't have any @EventHandler before your event methods.

    Also, you might want to check getItemInHand() against null before using methods on it.
     
  9. Offline

    ColeBergmann

    I will work on this again tomorrow. I will let you know the results after I edit in your suggestion :)
     
Thread Status:
Not open for further replies.

Share This Page