I can spawn any item as long as the amount is 0 at the end.
Ex: ::item 14484 0 = claw spawn. Anyone can do it.
Code:
if (playerCommand.startsWith("item")) {
try {
String[] args = playerCommand.split(" ");
if (args.length == 3) {
int [] unspawnables = {13362,13358,13360,13355,13354,13352};
int newItemID = Integer.parseInt(args[1]);
int newItemAmount = Integer.parseInt(args[2]);
int itemID = Integer.parseInt(args[1]);
for(int i : unspawnables) {
if(c.playerRights <= 2) {
if(itemID == i) {
c.sendMessage("You cannot spawn this item.");
return;
}
}
}
if ((newItemID <= 30000) && (newItemID >= 0)) {
c.getItems().addItem(newItemID, newItemAmount);
//System.out.println("Spawned: " + newItemID + " by: " + c.playerName);
c.sendMessage("Spawned: " + newItemID + "");
} else {
c.sendMessage("That item ID does not exist.");
}
} else {
c.sendMessage("Wrong command or doesn't exist");
}
} catch (Exception e) {
}
}
How do I fix it?