Originally Posted by
Lan Island
Sorry mate, Command code i'm not that good.
Command code? Not to be rude but code is code. Either you know how to program stuff or you don't whether it be basic or complicated.
Code:
if(command == item) {
String[] commandSplit = command.split(" ");
int item = Integer.parseInt(commandSplit[1]);
int amount = Integer.parseInt(commandSplit[2]);
for(int i = 0; i <= amount; i++) {
if(item != badItem1 && item != badItem2){
addItem(item, amount);
} else {
gameMessage("You can't spawn this item");
}
}
}
All basic java, maybe you can go basic-intermediate by adding arrays for bad items. Dont troll on convetions, r-s wont let me do it.
Some parts may be incorrect but I was going for speed.
That took me about 72 seconds, I drank some water at about 23 seconds though.