Does anyone know a good system for optional arguments. By this I mean something similar to this /additem [id] [amount] [name] [durability] [enchantment] Players could skip an argument if they want though. Like if they didn't want to write the durability then it would just default to max. So I could write /additem id:276 durability:54 and it would give me a diamond sword with 54 durability. The others would just default. To achieve this I had a few ideas but they all ended up with messy code and bugs. Sorry if i'm asking to much here but thanks for your help anyway.
This is really neat, too bad I know nearly nothing about code Well hopefully you get helped! I'm struggling too aha.
Ad237 Yes, switch the args.length and add arguments: Code:java switch (args.length()) {case: 1://code for 1 argumentbreak;case: 2://code for 2 argumentsbreak;//etc}