Jump to content

cooperwl1

Members
  • Posts

    1
  • Joined

  • Last visited

cooperwl1's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. For my computer science class I'm making a Fortnite Minecraft copy, I am making a gun that is pretty simple and I want the gun to destroy a certain block type which I make myself when the arrow from the gun hits the block. How would I go about doing this? This is my code so far GUN CODE package tealsmc.mods.items; import java.util.Random; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.event.entity.player.ArrowNockEvent; public class FortnitePistol extends Item { public FortnitePistol() { setCreativeTab(CreativeTabs.tabTools); this.setFull3D(); this.setMaxStackSize(1); this.setMaxDamage(10); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { EntityArrow var8 = new EntityArrow(par2World, par3EntityPlayer, 1.0F); par2World.spawnEntityInWorld(var8); return par1ItemStack; } } BLOCK CODE package tealsmc.mods.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; public class FortniteWood extends Block{ public FortniteWood(Material mat) { super(mat); setCreativeTab(CreativeTabs.tabBlock); } } I am also using the TEALS educational modpack but it is just Forge, just to clear up any confusion on the package.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.