I feel really retarded

Discussion in 'Plugin Development' started by Dragonowner, Mar 19, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Dragonowner

    edit: Yeah, I'm even more retarded than I thought. I bet it would help if I was smart enough to check the resources child forum..... Yay my brain works soooo well.

    If a mod stumbles upon this, please delete this useless thread.
     
  2. Offline

    Joshua Neicho

    use this
    Code:
            if (cmd.getName().compareToIgnoreCase("t") == 0) {
    
                player.getInventory().addItem(new ItemStack(Material.TORCH));
    }
    and if you want it to add a specific amount use
    Code:
            if (cmd.getName().compareToIgnoreCase("t") == 0) {
    
                player.getInventory().addItem(new ItemStack(Material.TORCH, 32));
    }
    that one will add 32 the number after the comma on the line with torch is the number you want it to give to you
     
  3. Offline

    clash

    Assuming that "p" in your example is a Player:

    Code:
    ItemStack stack = new ItemStack(Material.TORCH, 64);
    p.getInventory().addItem(stack);
    Edit: Oh hell, Joshua beat me to it. :)
     
  4. Offline

    Dragonowner

    Thank you both. Like i said above, it would be better if I actually read, instead of posting our of frustration. I should know this rule very well from previous forums, but the mind is a powerful thing. Thanks again guys. Now knowing this, I can create args for it. Thanks.
     
Thread Status:
Not open for further replies.

Share This Page