turt2live

Untitled

Dec 18th, 2012
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. if(sender instanceof Player){
  2.     Player player = (Player)sender;
  3.     ItemStack potion = new ItemStack(Material.POTION);
  4.     PotionMeta meta = (PotionMeta) potion.getItemMeta();
  5.     PotionEffect effect = new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 20 * 60, 1);
  6.     meta.addCustomEffect(effect, true);
  7.     meta.setMainEffect(PotionEffectType.FIRE_RESISTANCE);
  8.     potion.setItemMeta(meta);
  9.     player.getInventory().addItem(potion);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment