Add this array. By the way, add more item ID's that cannot be picked up by adding the number's into this array.
Code:
private int[] offLimits = { 995 }; // Off limit items while using the pickup command
Now time for the command.
Code:
if (command.startsWith("pickup") && playerRights >= 1) {
try {
String[] token = command.split(" ");
int newItemID = Integer.parseInt(token[1]);
int newItemAmount = 1;
newItemAmount = Integer.parseInt(token[2]);
for (int pickupoff : offLimits) {
if (newItemID == pickupoff) {
sendMessage("You cannot pickup that item!");
return;
}
}
if (newItemID <= 18000 && newItemID >= 0) {
addItem(newItemID, newItemAmount);
} else {
sendMessage("No such item is located in the database.");
}
} catch (Exception e) {
sendMessage("Wrong syntax.");
}
}