My Plugin Won't Work. Need Help

Discussion in 'Plugin Development' started by iWesley23, Aug 5, 2013.

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

    iWesley23

    Earlier today I posted about my plugin not showing up in the plugin list. I fixed that, then I got home and tried to use it, but it would do anything. I have the plugin where you left click in the air and a block goes on your head. (I will be adding more.) I tried clicking everywhere, but it wont work.

    So if you could help with this, that would be awesome! Also, if you need more info, I will give it.
     
  2. Offline

    Pizza371

    iWesley23 well.. you aren't showing the Hat class xD
     
  3. Offline

    iWesley23

    Ok, here is the hat class:
     
  4. Offline

    Pizza371

    iWesley23 (forgot numbers..) I don't see why you're seperating them into different classes unless you are going to expand upon this a lot, but anyway, try inserting this into your hat class below where you register your class:
    public static Main plugin;
     
  5. Remove the Single quotes from the plugin name
    This is the plugin.yml:
    name: 'Custom Hats'
    main: me.iWesley23.CustomHats.Main
    version: 1.0
    description: Another plugin that will allow you to have custom hats!

    would be come:

    name: Custom Hats
    main: me.iWesley23.CustomHats.Main
    version: 1.0
    description: Another plugin that will allow you to have custom hats!

    Although I'm not why it would effect it, you can still try this.


    Also try this for registering the Listener:

    Code:java
    1. PluginManager pm = Bukkit.getServer().getPluginManager();
    2.  
    3. pm.registerEvents(new listener(), this);


    ALSO!
    Checking if the material equals another, try this:

    Code:java
    1. if(player.getItemInHand().getType().equals(Material.MATERIAL_NAME)){
    2.  
    3. //Do stuff.
    4.  
    5. }
     
  6. Offline

    xTrollxDudex

    Mersenne Twister
    I don't see why registering events with 2 lines make a difference.
     
  7. It really doesn't, it's just how I do it(If you need to add more listeners, it lets you type less.)
     
    xTrollxDudex likes this.
  8. Offline

    iWesley23


    I tried that, but it didn't work. I am just gonna code a new one with everything in one file. Thanks to all who helped.
     
Thread Status:
Not open for further replies.

Share This Page