First Timer...

Discussion in 'Plugin Development' started by megasaad44, Mar 9, 2014.

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

    megasaad44

    Hello, I just tried my hand at this stuff by making a gamemode changing plugin, for now i just made it to change your gamemode to creative when you type gm 1.
    Now.. I didn't see any problems, but when i exported it, it gave a weird error.
    The problems i think i have are:
    1) Package, file, yml, and class naming.
    2) Code error.

    Here is my code:
    http://pastebin.com/zEwGWdQn

    Here is my plugin yml:
    Code:
    author: LordSaad44
    description: TerraMC commands and utilities.
    main: me.lordsaad44.plugins.terramc.Terramc
    name: TerraMC
    version: '1.0'
    And here is my... explorer thingy:
    http://prntscr.com/2za868

    Soo.. Where is the error?
     
  2. Offline

    GameplayJDK

    megasaad44
    You have to give us the error. Otherwise we can't tell you what's your mistake
    You have to remove the ' from your version!
     
  3. Offline

    megasaad44

  4. Offline

    GameplayJDK

    megasaad44
    It seems that you haven't described the path to your plugins main class correctly.
    So change the main to me.LordSaad44.terramc.Terramc
    The main property is case sensitive!
     
  5. Offline

    GalaxyBeatzz

    Same as GameplayJDK your plugin.yml should be changed to this: me.LordSaad44.terramc.Terramc
     
  6. Offline

    megasaad44

  7. Offline

    GalaxyBeatzz

    Still that was not what I was saying... Read again.
     
  8. Offline

    GameplayJDK

    megasaad44
    You've used a YAML parser for the Java code?
     
  9. Offline

    megasaad44

  10. Offline

    GameplayJDK

    megasaad44
    I have to correct myself..
    So change the main again, and now to me.LordSaad44.terramc.Terramc.Terramc
    When I say "main" I mean the main property in the plugin.yml file, not the package
     
  11. Offline

    megasaad44

    GameplayJDK
    ...
    Explain more please ._.
    Which is the property? Do you mean the yml? Do you mean in the code?
    Really sorry, i admit i'm slow...
     
  12. Offline

    GameplayJDK

    No problem:
    By saying "main-property" I basically mean the line with "main: package.mainclassname" in it.
    The "package" is the "me.LordSaad44.terramc.Terramc" thing in your file explorer. But you have to append the name of your plugins main class, in your case "Terramc" to it.
    So just change your plugin.yml content to the following:
    Code:
    author: LordSaad44
    description: TerraMC commands and utilities.
    main: me.LordSaad44.terramc.Terramc.Terramc
    name: TerraMC
    version: 1.0
     
  13. Offline

    megasaad44

    GameplayJDK
    Unknown command T u T
    No error....

    Bump. Plugin doesn't do anything xD

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

    BappleCraftColt

    megasaad44 You havn't registered your command in onEnable or plugin.yml
    Thats probley why it's giving Unknown command.
     
  15. Offline

    N00BHUN73R

    megasaad44
    Code:
    author: LordSaad44
    description: TerraMC commands and utilities.
    main: me.LordSaad44.terramc.Terramc.Terramc
    name: TerraMC
    version: 1.0
    commands:
      gm:
        description: Change your gamemode!
     
  16. Offline

    megasaad44

  17. Offline

    N00BHUN73R

    megasaad44
    hmmm
    Can i see the command class? Or main class if its in the main one
     
Thread Status:
Not open for further replies.

Share This Page