Formatting commands in plugin.yml

This page is intended to learn beginners how to format commands in their plugins' ymls. Yes, this is for plugin devs. I'll describe you that using this example:

name: HelpPlus
main: sk.tomsik68.helpplus.HelpPlus
author: Tomsik68
version: 0.5
description: Plugin which provides helpful information about commands
# This is what you should look at!
commands:
    hp:
        usage: /hp [page | plugin]
        aliases: ['/help','/h+']
        description: Displays help
    help:
        usage: /help [page | plugin]
        aliases: ['/hp','/h+']
        description: Displays help
    h+:
        usage: /h+ [page | plugin]
        aliases: ['/hp','/help']

What does this mean?

# Required
name: HelpPlus
# Required
main: sk.tomsik68.helpplus.HelpPlus
# Optional
author: Tomsik68
# Required
version: 0.5
# Optional
description: Plugin which provides helpful information about commands

These are information about your plugin. See bukkit's wiki for more info on these.

But now, the more interesting part:

commands:
    hp:
        usage: /hp [page | plugin]
        aliases: ['/help','/h+']
        description: Displays help
    help:
        usage: /help [page | plugin]
        aliases: ['/hp','/h+']
        description: Displays help
    h+:
        usage: /h+ [page | plugin]
        aliases: ['/hp','/help']

This tells server, that this plugin has 3 commands: /hp , /help and /h+. (Yes, they must be without / in plugin.yml). Usage is the thing you get written when you type command wrong or pass in invalid parameters. Description is description of what the command does. Aliases are another commands you can type instead of this one. If you don't know how to write YML, check great page by CraftIRC - Complete idiot's guide to YAML.


Comments

Posts Quoted:
Reply
Clear All Quotes