Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @author Arno
- * Description
- */
- private int[] forbiddenItems = {11694,11724,11726,11725,11727,11695,11730,11732,11731,11733};//restricted items to spawn
- if (playerCommand.startsWith("item")) {
- if (c.inWild())
- return;
- try {
- String[] args = playerCommand.split(" ");
- if (args.length == 3) {
- int newItemID = Integer.parseInt(args[1]);
- int newItemAmount = Integer.parseInt(args[2]);
- for (int i : forbiddenItems) {
- if (newItemID == i) {
- c.sendMessage("@red@You can't spawn this item!");
- return;
- }
- }
- if ((newItemID <= 20000) && (newItemID >= 0)) {
- c.getItems().addItem(newItemID, newItemAmount);
- System.out.println(c.playerName+" spawned " + newItemID);
- } else {
- c.sendMessage("No such item.");
- }
- } else {
- c.sendMessage("Use as ::item 995 200");
- }
- } catch (Exception e) {
- }
- }
Add Comment
Please, Sign In to add comment