Solved Arguments Help

Discussion in 'Plugin Development' started by chasechocolate, Jan 10, 2013.

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

    chasechocolate

    Hi, I am kind of spacing out now and can't figure out why my command isn't working. Here is my code: http://dev.bukkit.org/paste/6861/ Whenever I type /thehidden join/leave (or any other /thehidden command) it will respond /thehidden and tell me in console that I have an OutOfBoundsException yet I have check the args.length in every command. Anyone know how I can fix this? Oh, here is my plugin.yml:
    Code:
    name: TheHidden
    main: com.chasechocolate.thehidden.TheHidden
    version: 01.10.13
    Author: [chasechocolate/Nauss]
    dependencies: [TagAPI]
    commands:
      thehidden:
        description: The main hidden command
        usage: /thehidden
     
  2. Offline

    coobro123

  3. Offline

    CeramicTitan

    coobro123


    it's not in the plugin.yml. The problem is caused by your actual code.
    http://dev.bukkit.org/paste/6864/ //I think i fixed it. Maybe just double check.
     
  4. Offline

    chasechocolate

    Wait so args.length start with the base command (/test)? I thought that if you do args[0] it will get the first argument /test <argument0>
     
  5. Offline

    CeramicTitan

    yes, exactly.
     
  6. Offline

    ZeusAllMighty11

    You have to check args length, and check it correctly or you will get OutOfBounds exceptions



    Edit: I also notice you have 2 of the same command... lolwut
     
  7. Offline

    chasechocolate

    Ah, ok, thanks for clarifying that! Oh, I probably have two because I copied and pastes some of the code and just switched a few things.
     
Thread Status:
Not open for further replies.

Share This Page