Thread: ::item Command unspawnable items

Results 1 to 4 of 4
  1. #1 ::item Command unspawnable items 
    Registered Member timtimmay123's Avatar
    Join Date
    Jul 2011
    Age
    26
    Posts
    103
    Thanks given
    2
    Thanks received
    13
    Rep Power
    11
    I don't know where to add this, either help me and explain why or don't post at all..

    Code:
    for (int i : Config.UNSPAWNABLE_ITEMS) {
    						if (i == newItemID) {
    							c.sendMessage("This item is unspawnable.");
    							return;
    Where does that go into this?
    Code:
    			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]);
    						if ((newItemID <= 20500) && (newItemID >= 0)) {
    							c.getItems().addItem(newItemID, newItemAmount);		
    						} else {
    							c.sendMessage("That item ID does not exist.");
    						}
    					} else {
    						c.sendMessage("Wrong usage: (Ex:(::pickup_ID_Amount)(::item 995 1))");
    					}
    				} catch(Exception e) {
    					
    				}
    				}
    Thanks in advance, and i do already have the unspawnables in the config.. i just get compile errors when i put in that part of the code (up top)
    Reply With Quote  
     

  2. #2  
    Registered Member Stewie1million's Avatar
    Join Date
    Jun 2011
    Posts
    588
    Thanks given
    2
    Thanks received
    56
    Rep Power
    14
    Put it right under playercommand.startswith then add a bracket after that (before if in wild)
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    below the

    if (c.inWild())
    return;
    Reply With Quote  
     

  4. #4  
    Registered Member Stewie1million's Avatar
    Join Date
    Jun 2011
    Posts
    588
    Thanks given
    2
    Thanks received
    56
    Rep Power
    14
    Quote Originally Posted by relex lawl View Post
    below the

    if (c.inWild())
    return;
    It could go below or above wouldn't make a difference.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [Pi] Unspawnable items
    By Dharmesh in forum Help
    Replies: 0
    Last Post: 09-24-2011, 01:05 PM
  2. Unspawnable items
    By kopjekoffiee in forum Snippets
    Replies: 11
    Last Post: 08-26-2011, 04:09 AM
  3. Unspawnable items
    By Kaiser Btw in forum Configuration
    Replies: 5
    Last Post: 07-23-2011, 11:42 PM
  4. Unspawnable items
    By 'Ramon in forum Help
    Replies: 3
    Last Post: 02-17-2009, 01:36 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •