heres my item code in commands.java
Code:
if(playerCommand.startsWith("item")||playerCommand.startsWith("pickup")) {
if (c.inWild() && c.inFFA()) {
c.sendMessage("Can't do this here bud");
return;
}
try
{
if (c.playerRights == 7 || c.playerRights == 6 || c.playerRights == 5)
{
return;
}
String[] args = playerCommand.split(" ");
if (args.length == 3)
{
int newItemID = Integer.parseInt(args[1]);
for(int i : restrictedItems) {
if(i == newItemID) {
c.sendMessage("This item can only be recieved via PKP Shop or Donator Shop.");
return;
}
}
int newItemAmount = Integer.parseInt(args[2]);
if(newItemAmount >= 2147483647) {
c.sendMessage("Please try spawning a lower amount of items.");
return;
}
if ((newItemID <= 21000) && (newItemID >= 0))
{
c.getItems().addItem(newItemID, newItemAmount);
c.sendMessage("You succesfully spawned @blu@" + newItemAmount +" @bla@of the item @red@" + newItemID + "@bla@.");
} else
{
c.sendMessage("That item ID does not exist.");
}
} else
{
c.sendMessage("Wrong usage: (Ex:(::item_ID_Amount)(::item 995 1))");
}
} catch (Exception e)
{
}
}
if i try spawn torva helm for example it says "his item can only be recieved via PKP Shop or Donator Shop.""