SHARE
TWEET

ItemBullet.java

Camellias_ Jul 7th, 2017 25 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package items;
  2.  
  3. import entities.EntityBullet;
  4. import net.minecraft.creativetab.CreativeTabs;
  5. import net.minecraft.entity.EntityLivingBase;
  6. import net.minecraft.entity.player.EntityPlayer;
  7. import net.minecraft.entity.projectile.EntityArrow;
  8. import net.minecraft.entity.projectile.EntityTippedArrow;
  9. import net.minecraft.item.Item;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraft.world.World;
  12.  
  13. public class ItemBullet extends Item
  14. {
  15.     public ItemBullet()
  16.     {
  17.         this.setCreativeTab(CreativeTabs.COMBAT);
  18.     }
  19.  
  20.     public EntityArrow createArrow(World worldIn, ItemStack stack, EntityLivingBase shooter)
  21.     {
  22.         EntityTippedArrow entitytippedarrow = new EntityTippedArrow(worldIn, shooter);
  23.         entitytippedarrow.setPotionEffect(stack);
  24.         return entitytippedarrow;
  25.     }
  26.  
  27.     public boolean isInfinite(ItemStack stack, ItemStack bow, net.minecraft.entity.player.EntityPlayer player)
  28.     {
  29.         int enchant = net.minecraft.enchantment.EnchantmentHelper.getEnchantmentLevel(net.minecraft.init.Enchantments.INFINITY, bow);
  30.         return enchant <= 0 ? false : this.getClass() == ItemBullet.class;
  31.     }
  32.  
  33.     public EntityBullet createBullet(World worldIn, ItemStack itemstack, EntityPlayer entityplayer) {
  34.         // TODO Auto-generated method stub
  35.         return null;
  36.     }
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top