I tried following the Tutorial on the Forge forums for a Blaster Rifle but I think it is a few versions old and I am getting a few errors
here is my Gun code:
package com.halo.halomod.tools;
import com.halo.halomod.EntityMagnumBullet;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemMagnum extends Item
{
public ItemMagnum(int par1)
{
super();
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,EntityPlayer par3EntityPlayer) {
if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem((Item) Item.itemRegistry.getObject("stick")))
{
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld([color=red]new EntityMagnumBullet(par2World, par3EntityPlayer));[/color]
*Error The Constructor EntityMagnumBullet(World, EntityPlayer) is undefined*
}
}
return par1ItemStack;
}
}
Here is my Bullet Code:
package com.halo.halomod;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityMagnumBullet extends EntityThrowable
{
public EntityMagnumBullet(World par1World)
{
super(par1World);
}
public EntityMagnumBullet(World par1World, EntityLiving par2EntityLiving)
{
super(par1World, par2EntityLiving);
}
public EntityMagnumBullet(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
@Override
protected void onImpact(MovingObjectPosition movingobjectposition){
// TODO Auto-generated method stub
}
}