TequilAxBr Postado Agosto 28, 2015 Denunciar Compartilhar Postado Agosto 28, 2015 Olá humanos, gostaria de saber como dou uma potion a um player já tentei om new ItemStack(Material.GLASS_BOTTLE, 1, (byte) 8257); porem não funfou... Alguêm poderia me ajuda? Link para o comentário Compartilhar em outros sites More sharing options...
Guest ~iNotLinduh. Postado Agosto 29, 2015 Denunciar Compartilhar Postado Agosto 29, 2015 (editado) Assim Meu Querido :S ItemStack Potion = new ItemStack(Material.POTION); PotionMeta PotionM = (PotionMeta) Potion.getItemMeta(); PotionM.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 200 * 100, 1), true); PotionM.addCustomEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200 * 200, 1), true); PotionM.addCustomEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200 * 200, 1), true); PotionM.addCustomEffect(new PotionEffect(PotionEffectType.REGENERATION, 200 * 200, 1), true); PotionM.setDisplayName("§cPoção Modinha"); Potion.setItemMeta(PotionM); //Não Tenho Certeza Mas O Tempo É Em "Tickets", 200 = 10 Segundos, *(Multiplicado) Por 100 "Tickets", //Eu Fiz 200 * 200, Deu Quase 30min. De Efeitos '-' Editado Agosto 29, 2015 por ~iNotLinduh. Link para o comentário Compartilhar em outros sites More sharing options...
Langsdorf Postado Agosto 28, 2015 Denunciar Compartilhar Postado Agosto 28, 2015 (editado) PotionMeta import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffectType; public static void p(Player p, PotionEffectType pte) { ItemStack pt = new ItemStack(Material.POTION); PotionMeta ptm = (PotionMeta)pt.getItemMeta(); ptm.setMainEffect(pte); ptm.setDisplayName("§cPoçaum"); pt.setItemMeta(ptm); p.getInventory().addItem(pt); } p(p, PotionEffectType.CONFUSION); Editado Agosto 28, 2015 por stalker112 Link para o comentário Compartilhar em outros sites More sharing options...
Guest ~iNotLinduh. Postado Agosto 28, 2015 Denunciar Compartilhar Postado Agosto 28, 2015 (editado) Simples: Potion Slow = new Potion(PotionType.SLOWNESS); ItemStack Slow2 = new ItemStack(Material.POTION); Slow.setSplash(true); //Seta Se Vai Ser Arremessável Ou Não. Slow.setLevel(1); //Seta O Level Da Poção. Slow.apply(Slow2); //Aplica O Efeito Da Poção, Da Pra Criar Poções Editadas Assim :) Depois Você Adiciona No Inventory Do Player Assim: p.getInventory().addItem(Slow2); Editado Agosto 28, 2015 por ~iNotLinduh. Link para o comentário Compartilhar em outros sites More sharing options...
TequilAxBr Postado Agosto 28, 2015 Autor Denunciar Compartilhar Postado Agosto 28, 2015 Simples: Potion Slow = new Potion(PotionType.SLOWNESS); ItemStack Slow2 = new ItemStack(Material.POTION); Slow.setSplash(true); //Seta Se Vai Ser Arremessável Ou Não. Slow.setLevel(1); //Seta O Level Da Poção. Slow.apply(Slow2); //Aplica O Efeito Da Poção, Da Pra Criar Poções Editadas Assim :) Depois Você Adiciona No Inventory Do Player Assim: p.getInventory().addItem(Slow2); Ok, e como defino o tempo que vai durar? Link para o comentário Compartilhar em outros sites More sharing options...
Guest ~iNotLinduh. Postado Agosto 28, 2015 Denunciar Compartilhar Postado Agosto 28, 2015 (editado) Ok, e como defino o tempo que vai durar? Daquele Modo Não Dá, Teria Que Ser Assim: ItemStack Potion = new ItemStack(Material.POTION, 1 (short)16384); //Com O ID Da Poção :x PotionMeta PotionM = (PotionMeta) Potion.getItemMeta(); PotionM.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1), true); //200 = Duração, 1 = Aplificação Da Poção. Potion.setItemMeta(PotionM); Para Dar O Player A Poção: p.getInventory().addItem(Potion); Editado Agosto 28, 2015 por ~iNotLinduh. Link para o comentário Compartilhar em outros sites More sharing options...
TequilAxBr Postado Agosto 28, 2015 Autor Denunciar Compartilhar Postado Agosto 28, 2015 Daquele Modo Não Dá, Teria Que Ser Assim: ItemStack Potion = new ItemStack(Material.POTION, 1 (short)16384); //Com O ID Da Poção :x PotionMeta PotionM = (PotionMeta) Potion.getItemMeta(); PotionM.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1), true); //200 = Duração, 1 = Aplificação Da Poção. Potion.setItemMeta(PotionM); Para Dar O Player A Poção: p.getInventory().addItem(Potion); E pra dar varios efeitos ne uma pot só tipo na de regenração vir força speed e etc Link para o comentário Compartilhar em outros sites More sharing options...
Karamujo Postado Agosto 28, 2015 Denunciar Compartilhar Postado Agosto 28, 2015 E pra dar varios efeitos ne uma pot só tipo na de regenração vir força speed e etc Eu faria assim usando o evento de interação com o item @EventHandler public void onPlayerInteract(PlayerInteractEvent e) { ItemStack Potion = new ItemStack(Material.POTION, 1 ,(short)16384); PotionMeta PotionM = (PotionMeta) Potion.getItemMeta(); PotionM.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1), true); PotionM.setDisplayName("sla"); if(e.getItem() == Potion && e.getItem().getItemMeta().getDisplayName().equalsIgnoreCase(PotionM.getDisplayName()) { if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) { Player p = e.getPlayer(); p.playEffect(/*Ai voce termina usando varios desses*/); p.playEffect(/*...*/); p.playEffect(/*...*/); } } } Link para o comentário Compartilhar em outros sites More sharing options...
leonardosc Postado Agosto 29, 2015 Denunciar Compartilhar Postado Agosto 29, 2015 Daquele Modo Não Dá, Teria Que Ser Assim: ItemStack Potion = new ItemStack(Material.POTION, 1 (short)16384); //Com O ID Da Poção :x PotionMeta PotionM = (PotionMeta) Potion.getItemMeta(); PotionM.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1), true); //200 = Duração, 1 = Aplificação Da Poção. Potion.setItemMeta(PotionM); Para Dar O Player A Poção: p.getInventory().addItem(Potion); Tento esse? Link para o comentário Compartilhar em outros sites More sharing options...
TequilAxBr Postado Agosto 29, 2015 Autor Denunciar Compartilhar Postado Agosto 29, 2015 Tento esse? Sim funcionou, só queria saber como fazer pra dar vários efeitos em um só potion .-. O do Karamujo não pego direito aq =/ Link para o comentário Compartilhar em outros sites More sharing options...
leonardosc Postado Agosto 29, 2015 Denunciar Compartilhar Postado Agosto 29, 2015 Sim funcionou, só queria saber como fazer pra dar vários efeitos em um só potion .-. O do Karamujo não pego direito aq =/ Repete isso PotionM.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1), true); Só que com efeito diferente --' Link para o comentário Compartilhar em outros sites More sharing options...
TequilAxBr Postado Agosto 29, 2015 Autor Denunciar Compartilhar Postado Agosto 29, 2015 Repete isso PotionM.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1), true); Só que com efeito diferente --' Não tipo, eu já fiz isso porem quero isso em um só frasco tipo na de regenração vir speed,força e etc Link para o comentário Compartilhar em outros sites More sharing options...
zMathi Postado Agosto 29, 2015 Denunciar Compartilhar Postado Agosto 29, 2015 Não tipo, eu já fiz isso porem quero isso em um só frasco tipo na de regenração vir speed,força e etc Entao cara '---' Link para o comentário Compartilhar em outros sites More sharing options...
Karamujo Postado Agosto 29, 2015 Denunciar Compartilhar Postado Agosto 29, 2015 Sua dúvida foi marcada como [Resolvido] e movido à área de dúvidas resolvidas.Atenciosamente,Gamer's Board Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
TequilAxBr
Olá humanos, gostaria de saber como dou uma potion a um player já tentei om new ItemStack(Material.GLASS_BOTTLE, 1, (byte) 8257); porem não funfou...
Alguêm poderia me ajuda?
Link para o comentário
Compartilhar em outros sites
13 respostass a esta questão
Posts Recomendados