1.14.4 'args.length' calls up 'java: cannot find symbol'

Discussion in 'Spigot Plugin Development' started by req_, Jan 12, 2020.

  1. Hi,

    I've been learning to make plugins for a while. In one of the test projects I came across an error while using args.length. In class I used this reference three times and got three same bugs: Error: java: cannot find symbol', when installing with Maven. I don't know what could cause it. Any ideas?

    Code: https://pastebin.com/w9sU39a3

    Thanks in advance for your help.
  2. Choco


    args doesn't exist. It's not defined anywhere. You likely want to refer to strings which is the parameter in the onCommand() method generally named args but was renamed
    • Agree Agree x 1
  3. How and where can I define it?
  4. Code (Text):
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings)
    replace "strings" with "args" here or replace "args" with "strings" in your code
    • Agree Agree x 2