I can work this out properly, pass me your current pickup command (the code of it)
|
|

I can work this out properly, pass me your current pickup command (the code of it)

Aight i will i thinked i could do the same but every time some code rong.
if (command.startsWith("pickup") && playerRights > 1) {
String[] args = command.split(" ");
if(args.length == 3) {
int newItemID = Integer.parseInt(args[1]);
int newItemAmount = Integer.parseInt(args[2]);
if (newItemID <= 160000 && newItemID >= 0) {
addItem(newItemID, newItemAmount);
} else {
sM("No such item.");
}
} else {
sM("Oops! Use as :ickup 995 100");
}
}
}
I wanna get it working normaly like this but i want a item list that u cant pickup one of these




I wont tell you where to add the int[] you need to do some work yourself.
Then add this to your pickup command, let me just copy kid aboves and use itCode:int[] noSpawn = {(all item ids here)};
Then just add all the items into that intCode:if (command.startsWith("pickup") && playerRights > 1) { String[] args = command.split(" "); if(args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); for (int element : noSpawn) { if (newItemID != element) { addItem(newItemID, newItemAmount); } else { sM("This Item cannot be picked up or does not exist"); } } else { sM("Oops! Use ::pickup 995 100"); } } } }


| « waterbirth [email protected]@@@@@@ | Could someone be so kind to make these shops for me? » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |