Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package theishiopian.gunmod.items;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.projectile.EntityArrow;
- import net.minecraft.entity.projectile.EntitySmallFireball;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemArrow;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.ActionResult;
- import net.minecraft.util.EnumActionResult;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.world.World;
- import theishiopian.gunmod.entity.EntityBullet;
- public class Shotgun extends Item
- {
- public Shotgun()
- {
- this.setUnlocalizedName("shotgun");
- this.setRegistryName("gun");
- this.setCreativeTab(CreativeTabs.COMBAT);
- this.setMaxStackSize(1);
- }
- @Override
- public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand)
- {
- if (!worldIn.isRemote)
- {
- for(int i = 0; i!=9; i++)
- {
- EntityBullet bullet = new EntityBullet(worldIn, playerIn);
- bullet.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0, 1, 7);
- bullet.world.spawnEntity(bullet);
- }
- }
- playerIn.getCooldownTracker().setCooldown(this, 20);
- return new ActionResult(EnumActionResult.PASS, playerIn.getHeldItem(hand));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement