Erezbiox1 submitted a new resource: CommandsAPI - Create Commands Easily With Annotations and Without plugin.yml Read more about this resource...
Getting an error when I tried using it..... https://pastebin.com/VXj0qJ54 -- edit: These are the changes I would make to fix the error.
Of course you are getting an error, This isn't how you supposed to use it, it's not a plugin, it's a library, the thing get's exported long side your plugin.
It's labeled as API and all of the APIs I've used before I just had in the plugins folder along with my plugin that links into it. But I think I do like it a lot like this!
Yeah I know, the title is misleading, The reason for that is at first, BioAPI ( CommandsAPI Parent ) was an actual API
Having trouble finding where I choose to export this together with my plugin.. Could you point me to the right area?
What is your IDE? In Eclipse, You go to build path, then add external jar In Intellij, you go to project structure, modules, add jar
Even though it's not supposed to be runnable jar I still export it as one? If not I think I understand. Thanks -- edit: Am I just allowed to copy the classes with there path directories from GitHub and add into my project because I did that and it works amazingly. I still have no clue how to add things to export so I'm sticking with what I have unless you say no -- edit: I've run into a few errors along the way. When running any of these commands as a Player it gives a message saying "Invalid Arguement please try again!", it's not an invalid argument. Get this nasty error when calling for a list of structures as a player but not as the console.. :/
Hey! I love your API! Is there a way to add OPTIONAL arguments to my commands with this API? As within your arguments spoiler, there seems to be no way to add an optional argument. Like, /kill (kills yourself), and /kill <OPTIONALARGUMENT>, kills the specified entity. (--Using 1.11.2--)
You can do that with an argument marker such as: Code (Text): @Command (name = "kill", arguments = "*", permissions = "kill.anything") public void killSomething(Player player, String[] args) { if (args[0].equalsIgnoreCase("@a")) { for (Player player : Bukkit.getOnlinePlayers()) { player.damage(Double.MAX_VALUE); } } } And star is whatever variable the player uses! You could also use two "**" in a row to make it only a number value, however I haven't really used that feature.