In commands.java add
And your ::item command should look like this when your done
Very easy to use,
To make an item unspawnable just put the item id example
Code:
private static final int unspawnables[] = {};
And your ::item command should look like this when your done
Code:
if (command[0].equals("item")) {
int itemId = Integer.parseInt(command[1]);
for (int id : unspawnables) {
if (id == itemId) {
player.sendMessage("You can't spawn this item.");
return;
}
}
if (command.length == 3) {
player.getInventory().addItem(Integer.parseInt(command[1]),
Integer.parseInt(command[2]));
} else {
player.getInventory().addItem(Integer.parseInt(command[1]), 1);
}
player.getInventory().refresh();
}
Very easy to use,
To make an item unspawnable just put the item id example
Code:
private static final int unspawnables[] = {11694, 1234, 4732};