How to create a command?

Would something like this work?

Code:
#name, main, version and api are required
name: Vanish
main: com.TheCoder2019.Vanish
version: "1.0.0"
api: ["1.0.5"]
load: POSTWORLD
author: TheCoder2019
description: Vanish
prefix: "Vanish"

commands:
  example:
    description: Vanish
    usage: "/vanish [enable | disable]"
    aliases: ["enable", "disable"]
    permission: exampleplugin.command.example
    permission-message: "Unknown command. Sorry!"
permissions:
  exampleplugin.command.example:
    description: "Allows the user to vanish"
    default: op

if (command.getName().equalsIgnoreCase("/vanish enable")) {

/effect @s invisibility 32767 1 true

}

if (command.getName().equalsIgnoreCase("/vanish disable")) {

/effect @s invisibility 0 0 true

}
 
Top