First plugin

Discussion in 'Plugin Development' started by MrAserFiles, Sep 3, 2013.

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

    MrAserFiles

    Hello, I want this to work

    It might be pretty obvious what I am trying to do, I just started learning Java and I thought this would be an easy place to start.

    http://pastebin.com/5Uvfy5bR
     
  2. Offline

    Chinwe

    Hey :)

    It seems like it should work, have you got a plugin.yml ?

    Two other things:
    • You dont need to log "Colours Enabled!" onEnable and onDisable, as this is done implicitly for all plugins anyway
    • May I suggest using ChatColor.translateAlternateColours() or § ?
    With §, you can simply do
    Code:
    player.sendMessage(§00§11§22§33...);
    Or with ChatColor.translateAlternateColours() you can
    Code:
    player.sendMessage(ChatColor.translateAlternateColours('&', "&00&11&22..."));

    Both these make your code easier to read!
     
    MrAserFiles likes this.
  3. MrAserFiles Did you registered your command in the plugin.yml?
     
  4. Offline

    MrAserFiles

    I have a plugin.yml .-.

    name: Colours
    Main: coloursmraserfiles.jaffas4life
    version: 1.0

    updated: http://pastebin.com/sr6A0isC

    name: Colours
    Main: coloursmraserfiles.jaffas4life
    version: 1.0
    commands:
    basic:
    description: List all colours.
    usage: /colour
    permission: Colours.list
    permission-message: You don't have <permission>

    New plugin.yml

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

    Chinwe

    MrAserFiles
    Is that formatted like that, or has posting it just removed it all?
    What it should be like:
    Code:
    name: blah
    main: blah (lowercase!)
    version: bleh
    commands:
      basic: (2 spaces!)
        description: bleh (4 spaces!)
        usage: blah
        etc
     
  6. Offline

    MrAserFiles

    its formatted correctly

    Works now :D called plugin.yml Plugin.yml

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

Share This Page