.Judgement Onyx user! Joined Mar 19, 2011 Posts 295 Reacts 0 Reputation 0 Credits 0 Oct 16, 2011 #1 In commands.java add 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};
In commands.java add 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};
Runescape™ Member Joined Sep 28, 2011 Posts 448 Reacts 0 Reputation 0 Credits 0 Oct 16, 2011 #2 Wow, I am liking all the tutorials you are putting up! Going to help get this section started!