Ir para conteúdo
  • 0

[Resolvido] [Ajuda] Batatas


LuizB

Pergunta

Porque estou recebendo só batatas '-' ?

 

 public static void kit1(Player p, Inventory s){
		 	ItemStack item = new ItemStack(Material.DIAMOND_PICKAXE);
			ItemMeta meta = item.getItemMeta();
			meta.addEnchant(Enchantment.DIG_SPEED, 19, true);
			meta.addEnchant(Enchantment.DURABILITY, 19, true);
			meta.addEnchant(Enchantment.LOOT_BONUS_BLOCKS, 19, true);
			item.setItemMeta(meta);
			
			ItemStack capaceteNB = new ItemStack(Material.DIAMOND_HELMET);
			ItemMeta metab = capaceteNB.getItemMeta();
			metab.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 19, true);
			metab.addEnchant(Enchantment.DURABILITY, 19, true);
			capaceteNB.setItemMeta(metab);
			
			ItemStack chestplateNB = new ItemStack(Material.DIAMOND_CHESTPLATE);
			ItemMeta metacb = chestplateNB.getItemMeta();
			metacb.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 19, true);
			metacb.addEnchant(Enchantment.DURABILITY, 19, true);
			chestplateNB.setItemMeta(metacb);
			
			ItemStack legNB = new ItemStack(Material.DIAMOND_LEGGINGS);
			ItemMeta metaleg = legNB.getItemMeta();
			metaleg.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 19, true);
			metaleg.addEnchant(Enchantment.DURABILITY, 19, true);
			legNB.setItemMeta(metaleg);
			
			ItemStack bootNB = new ItemStack(Material.DIAMOND_LEGGINGS);
			ItemMeta botmeta = bootNB.getItemMeta();
			botmeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 19, true);
			botmeta.addEnchant(Enchantment.DURABILITY, 19, true);
			bootNB.setItemMeta(botmeta);
			
			ItemStack espada = new ItemStack(Material.DIAMOND_SWORD);
			ItemMeta espadameta = espada.getItemMeta();
			espadameta.addEnchant(Enchantment.DAMAGE_ALL, 19, true);
			espadameta.addEnchant(Enchantment.DURABILITY, 19, true);
			espadameta.addEnchant(Enchantment.FIRE_ASPECT, 13, true);
			espadameta.addEnchant(Enchantment.KNOCKBACK, 2, true);
			espada.setItemMeta(espadameta);
			
			ItemStack frango = new ItemStack(Material.COOKED_CHICKEN, 64);
			ItemStack batata = new ItemStack(Material.BAKED_POTATO, 64);
			
			int emptySlot = p.getInventory().firstEmpty();

			  p.getInventory().setItem(emptySlot, bootNB);
			  p.getInventory().setItem(emptySlot, capaceteNB);
			  p.getInventory().setItem(emptySlot, legNB);
			  p.getInventory().setItem(emptySlot, chestplateNB);
			  p.getInventory().setItem(emptySlot, espada);
			  p.getInventory().setItem(emptySlot, item);
			  p.getInventory().setItem(emptySlot, frango);
			  p.getInventory().setItem(emptySlot, batata);
			}
Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

por que voce ta setando tudo no mesmo slot e se voce for ver a batata é o ultimo item setado

Ava é mesmo, e como faço pra setar esses items em um slot vazio ?

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...