Giving kits

Discussion in 'Spigot Plugin Development' started by brickconomy, May 12, 2017.

  1. So, I got some problems with giving a player a kit. The only thing the player gets are the normal seeds, nothing more. I also don't get an error in the console and I asked other developers, but they also don't see the problem. Do you know the problem? That should be pretty nice :)

    Code (Text):
    ItemStack potato = new ItemStack(Material.POTATO, 16);
                            ItemMeta pm = potato.getItemMeta();
                            pm.setDisplayName("§eAardappel");
                            potato.setItemMeta(pm);
                            p.getInventory().addItem(potato);
                         
                            ItemStack carrot = new ItemStack(Material.CARROT, 16);
                            ItemMeta cm = carrot.getItemMeta();
                            cm.setDisplayName("§6Wortel");
                            carrot.setItemMeta(cm);
                            p.getInventory().addItem(carrot);
                         
                            ItemStack seed = new ItemStack(Material.SEEDS, 16);
                            ItemMeta sm = seed.getItemMeta();
                            sm.setDisplayName("§aTarwenzaden");
                            seed.setItemMeta(sm);
                            p.getInventory().addItem(seed);
                         
                            ItemStack hoe = new ItemStack(Material.STONE_HOE, 1);
                            ItemMeta hm = hoe.getItemMeta();
                            hm.setDisplayName("§8Stenen schoffel");
                            hoe.setItemMeta(hm);
                            p.getInventory().addItem(hoe);
                         
                            p.sendMessage("§a§l>> §6Je hebt de kit Farm ontvangen.");
                            p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1, 1);
                            main.getConfig().set(p.getUniqueId() + ".cooldown.kits.farm.dagvanjaar", mDay);
                            main.saveConfig();
    mDay, mYear etc are variables created out of the calendar.
     
  2. CARROT and POTATO is the Block add _ITEM behind it and it should work
     
    • Agree Agree x 2
  3. Thanks :) I never knew that existed, but from now on xD
     
  4. Mark thread as solved.