Files
Mohammad-Ali Minaie b86dedad2f base mod created
2018-10-08 09:07:47 -04:00

28 lines
1000 B
Java

package net.minecraft.item;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntityTippedArrow;
import net.minecraft.world.World;
public class ItemArrow extends Item
{
public ItemArrow()
{
this.setCreativeTab(CreativeTabs.COMBAT);
}
public EntityArrow createArrow(World worldIn, ItemStack stack, EntityLivingBase shooter)
{
EntityTippedArrow entitytippedarrow = new EntityTippedArrow(worldIn, shooter);
entitytippedarrow.setPotionEffect(stack);
return entitytippedarrow;
}
public boolean isInfinite(ItemStack stack, ItemStack bow, net.minecraft.entity.player.EntityPlayer player)
{
int enchant = net.minecraft.enchantment.EnchantmentHelper.getEnchantmentLevel(net.minecraft.init.Enchantments.INFINITY, bow);
return enchant <= 0 ? false : this.getClass() == ItemArrow.class;
}
}