Solved Commands of Wrong Type

Discussion in 'Plugin Development' started by Awesomeman2, Sep 28, 2013.

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

    Awesomeman2

    21:00:49 [SEVERE] Could not load 'plugins\TESTING.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: commands are of wrong type

    What can i do to fix this?
     
  2. Offline

    adam753

    Can you post your plugin.yml?
    Oh, and the entire error please- if there's a line that says "caused by" then that would be useful.
     
  3. Offline

    Awesomeman2

    Code:
    name: Craftables
    main: me.serverdev.craftable.Craftable
    version: 2.2
    commands:
      Recipe Cow:
        description: Shows you the Recipe  of Cow
      Recipe Creeper:
        description: Shows you the Recipe of Creeper
      Recipe spider:
        description: Shows you the Recipe of spider
      Recipe wolf:
        description: Shows you the Recipe of wolf
      Recipe pig:
        description: Shows you the Recipe of pig
      Recipe Skeleton:
        description: Shows you the Recipe of Sheep
      Recipe skeleton:
        description: Shows you the Recipe of skeleton
      Recipe cavespider:
        description: Shows you the Recipe of cavespider
      Recipe enderman:
        description: Shows you the Recipe of enderman
      Recipe zombiepgment:
        description: Shows you the Recipe of zombiepigment
      Recipe ghast:
      description: Shows you the Recipe of ghast
      Recipe slime:
        description: Shows you the Recipe of slime
      Recipe blaze:
        description: Shows you the Recipe of blaze
      Recipe magmacube:
        description: Shows you the Recipe of magmacube
      Recipe witch:
        description: Shows you the Recipe of witch
      Recipe chicken:
        description: Shows you the Recipe of chicken
      Recipe Squid:
        description: Shows you the Recipe of Squid
      Recipe mooshroom:
        description: Shows you the Recipe of mooshroom
      Recipe Oceolot:
        description: Shows you the Recipe of Oceolot
      Recipe horse:
        description: Shows you the Recipe of horse
      Recipe Villager:
        description: Shows you the Recipe of Villager
      Recipe Bat:
        description: Shows you the Recipe of Bat
      Recipe Chainmalhelement:
        description: Shows you the Recipe of Chainmailhelement
      Recipe Chainmaichestplate:
        description: Shows you the Recipe of ChainmailChestplate
      Recipe Zombie:
        description: Shows you the Recipe of a zombie
      Recipe Chainmailboots:
        description: Shows you the Recipe of Chainmailboots
      Recipe ice:
        description: Shows you the Recipe of ice
      Recipe saddel:
        description: Shows you the Recipe of saddel
      update:
        description: Shows you the last update and what was added
       
        
    Code:
    21:33:04 [INFO] Starting minecraft server version 1.6.4
    21:33:04 [INFO] Loading properties
    21:33:04 [INFO] Default game type: SURVIVAL
    21:33:04 [INFO] Generating keypair
    21:33:05 [INFO] Starting Minecraft server on *:25565
    21:33:05 [INFO] This server is running CraftBukkit version git-Bukkit-1.6.2-R1.0
    -3-g9532cb6-b2889jnks (MC: 1.6.4) (Implementing API version 1.6.4-R0.1-SNAPSHOT)
     
    21:33:05 [SEVERE] Could not load 'plugins\TESTING.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: commands are of wrong type
            at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile
    .java:849)
            at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.
    java:188)
            at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPlug
    inLoader.java:252)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:132)
            at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugins(CraftServer.ja
    va:239)
            at org.bukkit.craftbukkit.v1_6_R3.CraftServer.<init>(CraftServer.java:21
    7)
            at net.minecraft.server.v1_6_R3.PlayerList.<init>(PlayerList.java:56)
            at net.minecraft.server.v1_6_R3.DedicatedPlayerList.<init>(SourceFile:11
    )
            at net.minecraft.server.v1_6_R3.DedicatedServer.init(DedicatedServer.jav
    a:107)
            at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java
    :393)
            at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:5
    83)
    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java
    .util.Map
            at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile
    .java:831)
            ... 10 more
    21:33:06 [INFO] Preparing level "world"
    21:33:06 [INFO] Preparing start region for level 0 (Seed: -2668573241614939912)
    21:33:07 [INFO] Preparing spawn area: 58%
    21:33:07 [INFO] Preparing start region for level 1 (Seed: 7507251277954139548)
    21:33:08 [INFO] Preparing spawn area: 96%
    21:33:08 [INFO] Preparing start region for level 2 (Seed: 7507251277954139548)
    21:33:09 [INFO] Server permissions file permissions.yml is empty, ignoring it
    21:33:09 [INFO] Done (3.382s)! For help, type "help" or "?"
    Code:
    ublic boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
        Player player = (Player) sender;
       
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("ghast")) {
                player.sendMessage("8 ghast tears around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("cow")) {
                player.sendMessage("8 leather around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("creeper")) {
                player.sendMessage("8 gunpowder around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("spider")) {
                player.sendMessage("8 string around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("wolf")) {
                player.sendMessage("8 bones around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("pig")) {
                player.sendMessage("8 prokchops around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("sheep")) {
                player.sendMessage("8 wool around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("skeleton")) {
                player.sendMessage("8 arrows around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("enderman")) {
                player.sendMessage("8 enderpearls around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("cavespider")) {
                player.sendMessage("8 fermentedspidereye around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("zombiepigment")) {
                player.sendMessage("8 leather around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("slime")) {
                player.sendMessage("8 slimeballs around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("blaze")) {
                player.sendMessage("8 blazepowder around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("magmacube")) {
                player.sendMessage("8 magmacream around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("witch")) {
                player.sendMessage("8 glassbottles around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("chicken")) {
                player.sendMessage("8 feathers around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("squid")) {
                player.sendMessage("8 inksacks around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("mooshroom")) {
                player.sendMessage("8 mushroomsoup around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("Oceolot")) {
                player.sendMessage("8 rawfish around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("horse")) {
                player.sendMessage("8 hayblock around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("villager")) {
                player.sendMessage("8 wheat around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("bat")) {
                player.sendMessage("8 coal around an egg");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("chainmail")) {
                player.sendMessage("normal armor with cobble");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("chainmail helement")) {
                player.sendMessage("normal armor with cobble");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("chainmail chestplate")) {
                player.sendMessage("normal armor with cobble");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("chainmail leggins")) {
                player.sendMessage("normal armor with cobble");
                return true;
            }
        }
        if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("chainmail boots")) {
                player.sendMessage("normal armor with cobble");
                return true;
            }
        }
        return true;
        }
    Theres everything and how the commands look adam753
     
  4. Offline

    KoolSource

    The plugin.yml file needs to be structured as described here: http://wiki.bukkit.org/Plugin_YAML . Your commands have spaces in them, which are not allowed. A command is the first part, in your case "Recipe". Every section after that ("Cow", "Chicken", etc) are all considered arguments and do not need to be included in your Plugin.yml file.

    Therefore you only need to have "recipe" and "update" as commands listed in your Plugin.yml file.

    -John
     
  5. Offline

    Awesomeman2

    KoolSource Lol i wasted alot of time, Thanks ill try that
     
  6. Offline

    KoolSource

    Also, reading through your code this will not work:

    Code:
    if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("chainmail leggins")) {
                player.sendMessage("normal armor with cobble");
                return true;
            }
        }
    
    You must do something like this:
    Code:
    if (cmd.getName().equalsIgnoreCase("recipe")){
            if (args[0].equalsIgnoreCase("chainmail") && args[1].equalsIgnoreCase("leggings")) {
                player.sendMessage("normal armor with cobble");
                return true;
            }
        }
    
     
  7. Offline

    Awesomeman2

    KoolSource It works without doing that, But thanks
     
Thread Status:
Not open for further replies.

Share This Page