First bukkit plugin problems!

Discussion in 'Plugin Development' started by matthewgeek123, Jul 6, 2014.

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

    matthewgeek123

    Hi
    I am VERY new to the area of bukkit plugin development and this is probably a terrible question.
    Anyway, I have been trying to make my first plugin and I have copied some code that says hello world whenever you type /test. Link: https://forums.bukkit.org/threads/tutorial-how-to-make-a-basic-plugin.170780/. I have my plugin.yml and I can't get the server to detect it. In my log file it says "Jar does not contain plugin.yml". I use the eclipse IDE. I have tried putting the plugin.yml file in al levels (in the package, in the src and everywhere else) but it still says no plugin.yml - link to my full log file: http://pastebin.com/1TLsykX5. Attached is a screenshot of my current file layout. EDIT: well apparently its not attached. Its now at the bottom of the post

    I know a teeny bit of basic java but not a heck of a lot.
    Any ideas?

    Thanks,
    Matthew
    [​IMG]
     

    Attached Files:

  2. Offline

    TheHandfish

    matthewgeek123: Welcome to the world of Bukkit! :)

    Could you post your plugin.yml here? It may be something to do with its syntax.
     
  3. Offline

    matthewgeek123

  4. Offline

    pookeythekid

    You put your plugin.yml directly into your Java Project; not in the src folders or etc. Also, do you know what to put in your plugin.yml?

    If you have no idea what I'm saying, YouTube is your friend... I have learned nearly every scrap of Java I know from YouTube. It will help you greatly.
     
  5. matthewgeek123 try using 1.0 instead of just 1 in the plugin.yml aswell.
     
  6. Offline

    RingOfStorms

    Depend on how you export/compile your jar, you will most likely need to move the plugin yml to the root project directory, rather than inside of the src directory.
     
  7. Offline

    myminecrafter01

    1. Your plugin name must be alphanumeric.
    2. Your pluin.yml should be in the root of your projects jar.
    3. You have the wrong path to your main class. Your package is named me.matthewgeek123.test but you put the package name as me.matthewgeek123.TestPlugin. In your plugin.yml it should be me.matthewgeek123.test.Main.
    More information on the plugin.yml can be found here on the Bukkit wiki.

    A few other things:
    Is there a particular reason you haven't indented your code? In Eclipse you can use Ctrl + Shift + F to auto format but you should indent your code as you type it as it will make it a lot easier to read and maintain.

    You print out "Disabled!" when the plugin is enabled and "Enabled!" when the plugin is disabled. While not technically wrong from a programming standpoint, it just seem silly.

    The tutorial you linked contains a lot of bad programming practices, you are better of following the official documentation on the Bukkit wiki. Here is a link to the official plugin tutorial.


    This is going to make no difference, the version option in the plugin.yml is an arbitrary string, so it can be what ever you like.
     
  8. Offline

    matthewgeek123

    Hi everyone,
    Thanks so much for the help, I have FINALLY got the plugin to work. Once I put the plugin.yml into the right folder, another error in my logs said it couldn't find my main class file and thats exactly what myminecrafter01 solved.

    Thanks so much for the help everyone.
    Now I can do it by myself!:)

    Matthew

    Hi
    Maybe I can't do it by myself:(
    I've kept on making my plugin and now nothing happens when I type in the command! Any ideas?
    It doesn't say unknown command or anything. Just nothing happens. I have changed the command from /test to /randtp
    and changed my plugin.yml accordingly. Link to code: http://pastebin.com/b1k2KD1E. Link to plugin.yml: http://pastebin.com/19L8SquT

    Thanks for the help

    Matthew

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

    61352151511

    The tabbing is really awkward to read, but at any time when the command reaches it's final state you should return true, in this case after player.teleport, also try using pworld.getHighestBlockYAt(randx, randz) For the Y axis, (Although I'm not sure if this will cause errors if the chunk isn't loaded)
     
  10. Offline

    HeadGam3z

    matthewgeek123
    You also might wanna remove the "World world" parameter in your onCommand()
     
  11. Offline

    matthewgeek123

    Hi
    I tried doing return true but that didn't work.:(
    In the tutorial I was watching he did the get highest block thing that but I was just pausing it and writing it bit by bit:)

    Matthew

    YESSSS :)
    Removing the World world parameter worked. Thanks!

    Matthew

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

Share This Page