Bukkit staff plugin

Discussion in 'Plugin Development' started by xXCapzXx, Apr 4, 2015.

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

    xXCapzXx

    I am making a plugin for staff that when you /StaffWand it will give you a staffwand, I did the permissions for /staffwand already, it's just that I don't want random players to get a stick and it will be a wand, so I am currently trying to make it like this:
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {

    if(cmd.getName().equalsIgnoreCase("StaffWand")) {

    if(!sender.hasPermission("StaffWand.staff")) {

    sender.sendMessage(ChatColor.RED + "Only Staff can use this!");


    }else{




    if(sender.hasPermission("StaffWand.staff")) {

    sender.sendMessage(ChatColor.GREEN + "Here is your staff wand!");

    ItemStack item = new ItemStack(Material.STICK, 1);

    ItemMeta meta = stick.getItemMeta();

    meta.setDisplayName("Staff Wand");

    ArrayList<String> lore = new ArrayList<String>();

    lore.add("Staff Wand");

    meta.setLore(lore);



    }else{

    if(Material.STICK != ItemMeta.meta);

    returnfalse;


    ((Player)sender).getInventory().addItem(item); return true;

    if(Material.STICK == ItemMeta.meta);

    returntrue;


    That is my code, I put the red on where it is not working, know how to fix?
     
  2. Offline

    nverdier

    @xXCapzXx Well it's completely invalid... I suggest you learn Java. Read about that here.
     
  3. Offline

    xXCapzXx

    I have learn't java, I just need some help with this, if the material has a meta name, the wand will work, if it doesn't, everything will return false?
     
  4. Offline

    nverdier

    Exactly. Java is required to make Bukkit plugins.
     
  5. Offline

    NoSpanMan

    I can help you i think so but first put your code between the [ code ] [ / code ] tags. (use not the spaces in the tag)
     
Thread Status:
Not open for further replies.

Share This Page