Jump to content

1.11 No Code errors, but crash on start up (thrownentity) (-slvd fix pg2)


Recommended Posts

Posted

Here are all the classes I have that are relative to the custom entity snowball, if someone would be nice enough to help me in this debacle it would be nice. I'm having a really hard time with this...

 

Main Class:

 

package exampled.modinfo;

import exampled.modinfo.init.ExampledEntities;
import exampled.modinfo.init.ExampledItems;
import exampled.modinfo.proxy.CommonProxy;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;

@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.MOD_VERSION)
public class Exampled
{
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
@Instance(Reference.MOD_ID)
private static Exampled instance;
private static ResourceLocation rsrcl;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	ModCreativeTabs.load();
	proxy.preInit();
	ExampledItems.init();
	ExampledItems.register();
	ExampledEntities.registerEntities(rsrcl);
	initRecipes();
}
    @EventHandler
    public void init(FMLInitializationEvent event)
    { 
	proxy.registerRenders();
        proxy.registerKeybindings();
        NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    }	
private static void initRecipes()
{
	GameRegistry.addRecipe(new ItemStack(ExampledItems.SPHERE), new Object[] {" X ",  "X X", " X ", 'X', Item.getItemFromBlock(Blocks.DIRT)});
}
public static Exampled getInstance()
{
	return instance;
}
public static ResourceLocation getResourceLocation()
{
	return rsrcl;
}
}

 

 

ModCreativeTabs:

 

package exampled.modinfo;

import net.minecraft.creativetab.CreativeTabs;

public class ModCreativeTabs {
public static CreativeTabs example_tab;
public static void load(){
	example_tab = new ExampledCreativeTab(CreativeTabs.getNextID());
}
}

 

 

ExampledCreativeTab:

 

package exampled.modinfo;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ExampledCreativeTab extends CreativeTabs {
public ExampledCreativeTab(int id) {
	super("example_tab");
}
@Override
public ItemStack getTabIconItem() {
	return new ItemStack(Items.ENCHANTED_BOOK);
}
}

 

 

References:

 

package exampled.modinfo;

public class Reference
{
public static final String MOD_ID = "exampled";
public static final String MOD_NAME = "change_this_to_set_mod_name";
public static final String MOD_VERSION = "1.0";

public static final String CLIENT_PROXY_CLASS = "exampled.modinfo.proxy.ClientProxy";
public static final String SERVER_PROXY_CLASS = "exampled.modinfo.proxy.CommonProxy";
}

 

 

EntityOrb(basicallyentitythrowable):

 

package exampled.modinfo.entity;

import java.util.List;
import java.util.UUID;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public abstract class EntityOrb extends Entity implements IProjectile
{
    private int xTile;
    private int yTile;
    private int zTile;
    private Block inTile;
    protected boolean inGround;
    public int throwableShake;
    /** The entity that threw this throwable item. */
    private EntityLivingBase thrower;
    private String throwerName;
    private int ticksInGround;
    private int ticksInAir;
    public Entity ignoreEntity;
    private int ignoreTime;

    public EntityOrb(World worldIn)
    {
        super(worldIn);
        this.xTile = -1;
        this.yTile = -1;
        this.zTile = -1;
        this.setSize(0.25F, 0.25F);
    }

    public EntityOrb(World worldIn, double x, double y, double z)
    {
        this(worldIn);
        this.setPosition(x, y, z);
    }

    public EntityOrb(World worldIn, EntityLivingBase throwerIn)
    {
        this(worldIn, throwerIn.posX, throwerIn.posY + (double)throwerIn.getEyeHeight() - 0.10000000149011612D, throwerIn.posZ);
        this.thrower = throwerIn;
    }

    protected void entityInit()
    {
    }

    /**
     * Checks if the entity is in range to render.
     */
    @SideOnly(Side.CLIENT)
    public boolean isInRangeToRenderDist(double distance)
    {
        double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D;

        if (Double.isNaN(d0))
        {
            d0 = 4.0D;
        }

        d0 = d0 * 64.0D;
        return distance < d0 * d0;
    }

    /**
     * Sets throwable heading based on an entity that's throwing it
     */
    public void setHeadingFromThrower(Entity entityThrower, float rotationPitchIn, float rotationYawIn, float pitchOffset, float velocity, float inaccuracy)
    {
        float f = -MathHelper.sin(rotationYawIn * 0.017453292F) * MathHelper.cos(rotationPitchIn * 0.017453292F);
        float f1 = -MathHelper.sin((rotationPitchIn + pitchOffset) * 0.017453292F);
        float f2 = MathHelper.cos(rotationYawIn * 0.017453292F) * MathHelper.cos(rotationPitchIn * 0.017453292F);
        this.setThrowableHeading((double)f, (double)f1, (double)f2, velocity, inaccuracy);
        this.motionX += entityThrower.motionX;
        this.motionZ += entityThrower.motionZ;

        if (!entityThrower.onGround)
        {
            this.motionY += entityThrower.motionY;
        }
    }

    /**
     * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
     */
    public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy)
    {
        float f = MathHelper.sqrt_double(x * x + y * y + z * z);
        x = x / (double)f;
        y = y / (double)f;
        z = z / (double)f;
        x = x + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy;
        y = y + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy;
        z = z + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy;
        x = x * (double)velocity;
        y = y * (double)velocity;
        z = z * (double)velocity;
        this.motionX = x;
        this.motionY = y;
        this.motionZ = z;
        float f1 = MathHelper.sqrt_double(x * x + z * z);
        this.rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI));
        this.rotationPitch = (float)(MathHelper.atan2(y, (double)f1) * (180D / Math.PI));
        this.prevRotationYaw = this.rotationYaw;
        this.prevRotationPitch = this.rotationPitch;
        this.ticksInGround = 0;
    }

    /**
     * Updates the velocity of the entity to a new value.
     */
    @SideOnly(Side.CLIENT)
    public void setVelocity(double x, double y, double z)
    {
        this.motionX = x;
        this.motionY = y;
        this.motionZ = z;

        if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
        {
            float f = MathHelper.sqrt_double(x * x + z * z);
            this.rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI));
            this.rotationPitch = (float)(MathHelper.atan2(y, (double)f) * (180D / Math.PI));
            this.prevRotationYaw = this.rotationYaw;
            this.prevRotationPitch = this.rotationPitch;
        }
    }

    /**
     * Called to update the entity's position/logic.
     */
    public void onUpdate()
    {
        this.lastTickPosX = this.posX;
        this.lastTickPosY = this.posY;
        this.lastTickPosZ = this.posZ;
        super.onUpdate();

        if (this.throwableShake > 0)
        {
            --this.throwableShake;
        }

        if (this.inGround)
        {
            if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)).getBlock() == this.inTile)
            {
                ++this.ticksInGround;

                if (this.ticksInGround == 1200)
                {
                    this.setDead();
                }

                return;
            }

            this.inGround = false;
            this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
            this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
            this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
            this.ticksInGround = 0;
            this.ticksInAir = 0;
        }
        else
        {
            ++this.ticksInAir;
        }

        Vec3d vec3d = new Vec3d(this.posX, this.posY, this.posZ);
        Vec3d vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
        RayTraceResult raytraceresult = this.worldObj.rayTraceBlocks(vec3d, vec3d1);
        vec3d = new Vec3d(this.posX, this.posY, this.posZ);
        vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);

        if (raytraceresult != null)
        {
            vec3d1 = new Vec3d(raytraceresult.hitVec.xCoord, raytraceresult.hitVec.yCoord, raytraceresult.hitVec.zCoord);
        }

        Entity entity = null;
        List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expandXyz(1.0D));
        double d0 = 0.0D;
        boolean flag = false;

        for (int i = 0; i < list.size(); ++i)
        {
            Entity entity1 = (Entity)list.get(i);

            if (entity1.canBeCollidedWith())
            {
                if (entity1 == this.ignoreEntity)
                {
                    flag = true;
                }
                else if (this.thrower != null && this.ticksExisted < 2 && this.ignoreEntity == null)
                {
                    this.ignoreEntity = entity1;
                    flag = true;
                }
                else
                {
                    flag = false;
                    AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expandXyz(0.30000001192092896D);
                    RayTraceResult raytraceresult1 = axisalignedbb.calculateIntercept(vec3d, vec3d1);

                    if (raytraceresult1 != null)
                    {
                        double d1 = vec3d.squareDistanceTo(raytraceresult1.hitVec);

                        if (d1 < d0 || d0 == 0.0D)
                        {
                            entity = entity1;
                            d0 = d1;
                        }
                    }
                }
            }
        }

        if (this.ignoreEntity != null)
        {
            if (flag)
            {
                this.ignoreTime = 2;
            }
            else if (this.ignoreTime-- <= 0)
            {
                this.ignoreEntity = null;
            }
        }

        if (entity != null)
        {
            raytraceresult = new RayTraceResult(entity);
        }

        if (raytraceresult != null)
        {
            if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK && this.worldObj.getBlockState(raytraceresult.getBlockPos()).getBlock() == Blocks.PORTAL)
            {
                this.setPortal(raytraceresult.getBlockPos());
            }
            else
            {
                this.onImpact(raytraceresult);
            }
        }

        this.posX += this.motionX;
        this.posY += this.motionY;
        this.posZ += this.motionZ;
        float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
        this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * (180D / Math.PI));

        for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * (180D / Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
        {
            ;
        }

        while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
        {
            this.prevRotationPitch += 360.0F;
        }

        while (this.rotationYaw - this.prevRotationYaw < -180.0F)
        {
            this.prevRotationYaw -= 360.0F;
        }

        while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
        {
            this.prevRotationYaw += 360.0F;
        }

        this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
        this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
        float f1 = 0.99F;
        float f2 = this.getGravityVelocity();

        if (this.isInWater())
        {
            for (int j = 0; j < 4; ++j)
            {
                float f3 = 0.25F;
                this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * 0.25D, this.posY - this.motionY * 0.25D, this.posZ - this.motionZ * 0.25D, this.motionX, this.motionY, this.motionZ, new int[0]);
            }

            f1 = 0.8F;
        }

        this.motionX *= (double)f1;
        this.motionY *= (double)f1;
        this.motionZ *= (double)f1;

        if (!this.hasNoGravity())
        {
            this.motionY -= (double)f2;
        }

        this.setPosition(this.posX, this.posY, this.posZ);
    }

    /**
     * Gets the amount of gravity to apply to the thrown entity with each tick.
     */
    protected float getGravityVelocity()
    {
        return 0.03F;
    }

    /**
     * Called when this EntityThrowable hits a block or entity.
     */
    protected abstract void onImpact(RayTraceResult result);

    public static void registerFixesThrowable(DataFixer fixer, String name)
    {
    }

    /**
     * (abstract) Protected helper method to write subclass entity data to NBT.
     */
    public void writeEntityToNBT(NBTTagCompound compound)
    {
        compound.setInteger("xTile", this.xTile);
        compound.setInteger("yTile", this.yTile);
        compound.setInteger("zTile", this.zTile);
        ResourceLocation resourcelocation = (ResourceLocation)Block.REGISTRY.getNameForObject(this.inTile);
        compound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString());
        compound.setByte("shake", (byte)this.throwableShake);
        compound.setByte("inGround", (byte)(this.inGround ? 1 : 0));

        if ((this.throwerName == null || this.throwerName.isEmpty()) && this.thrower instanceof EntityPlayer)
        {
            this.throwerName = this.thrower.getName();
        }

        compound.setString("ownerName", this.throwerName == null ? "" : this.throwerName);
    }

    /**
     * (abstract) Protected helper method to read subclass entity data from NBT.
     */
    public void readEntityFromNBT(NBTTagCompound compound)
    {
        this.xTile = compound.getInteger("xTile");
        this.yTile = compound.getInteger("yTile");
        this.zTile = compound.getInteger("zTile");

        if (compound.hasKey("inTile", )
        {
            this.inTile = Block.getBlockFromName(compound.getString("inTile"));
        }
        else
        {
            this.inTile = Block.getBlockById(compound.getByte("inTile") & 255);
        }

        this.throwableShake = compound.getByte("shake") & 255;
        this.inGround = compound.getByte("inGround") == 1;
        this.thrower = null;
        this.throwerName = compound.getString("ownerName");

        if (this.throwerName != null && this.throwerName.isEmpty())
        {
            this.throwerName = null;
        }

        this.thrower = this.getThrower();
    }

    @Nullable
    public EntityLivingBase getThrower()
    {
        if (this.thrower == null && this.throwerName != null && !this.throwerName.isEmpty())
        {
            this.thrower = this.worldObj.getPlayerEntityByName(this.throwerName);

            if (this.thrower == null && this.worldObj instanceof WorldServer)
            {
                try
                {
                    Entity entity = ((WorldServer)this.worldObj).getEntityFromUuid(UUID.fromString(this.throwerName));

                    if (entity instanceof EntityLivingBase)
                    {
                        this.thrower = (EntityLivingBase)entity;
                    }
                }
                catch (Throwable var2)
                {
                    this.thrower = null;
                }
            }
        }

        return this.thrower;
    }
}

 

 

EntitySphere That extends EntityOrb (snowball):

 

package exampled.modinfo.entity;

import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class EntitySphere extends EntityOrb
{
    public EntitySphere(World worldIn)
    {
        super(worldIn);
    }

    public EntitySphere(World worldIn, EntityLivingBase throwerIn)
    {
        super(worldIn, throwerIn);
    }

    public EntitySphere(World worldIn, double x, double y, double z)
    {
        super(worldIn, x, y, z);
    }

    public static void registerFixesSnowball(DataFixer fixer)
    {
        EntityThrowable.registerFixesThrowable(fixer, "Snowball");
    }

    @SideOnly(Side.CLIENT)
    public void handleStatusUpdate(byte id)
    {
        if (id == 3)
        {
            for (int i = 0; i < 8; ++i)
            {
                this.worldObj.spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
            }
        }
    }

    /**
     * Called when this EntityThrowable hits a block or entity.
     */
    protected void onImpact(RayTraceResult result)
    {
        if (result.entityHit != null)
        {
            int i = 0;

            if (result.entityHit instanceof EntityBlaze)
            {
                i = 3;
            }

            result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)i);
        }

        if (!this.worldObj.isRemote)
        {
            this.worldObj.setEntityState(this, (byte)3);
            this.setDead();
        }
    }
}

 

 

ModelOrb:

 

package exampled.modinfo.entity.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.util.ResourceLocation;

public abstract class ModelOrb extends ModelBase
{
    public abstract ResourceLocation getTexture();

public abstract boolean shouldBeTransparent();
}

 

 

ModelSphere:

 

package exampled.modinfo.entity.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;

public class ModelSphere extends ModelOrb
{
public ResourceLocation getTexture()
{
	return new ResourceLocation("exampled:textures/entity/sphere.png");
}

public boolean shouldBeTransparent()
{
	return true;
}

    ModelRenderer Shape1;
    ModelRenderer Shape2;
    ModelRenderer Shape3;
    ModelRenderer Shape4;
    ModelRenderer Shape5;
    ModelRenderer Shape6;
    ModelRenderer Shape7;
    ModelRenderer Shape8;
    ModelRenderer Shape9;
    ModelRenderer Shape10;
    ModelRenderer Shape11;
    ModelRenderer Shape12;
    ModelRenderer Shape13;
    ModelRenderer Shape14;
    ModelRenderer Shape15;
    ModelRenderer Shape16;
    ModelRenderer Shape17;
    ModelRenderer Shape18;
    ModelRenderer Shape19;
    ModelRenderer Shape20;
    ModelRenderer Shape21;
    ModelRenderer Shape22;
    ModelRenderer Shape23;
    ModelRenderer Shape24;
    ModelRenderer Shape25;
    ModelRenderer Shape26;
    ModelRenderer Shape27;
    ModelRenderer Shape28;
    ModelRenderer Shape29;
    ModelRenderer Shape30;
    ModelRenderer Shape31;
    ModelRenderer Shape32;
    ModelRenderer Shape33;
    ModelRenderer Shape34;
    ModelRenderer Shape35;
    ModelRenderer Shape36;
    ModelRenderer Shape37;
    ModelRenderer Shape38;
    ModelRenderer Shape39;
    ModelRenderer Shape40;
    ModelRenderer Shape41;
    ModelRenderer Shape42;
    ModelRenderer Shape43;
    ModelRenderer Shape44;
    ModelRenderer Shape45;
    ModelRenderer Shape46;
    ModelRenderer Shape47;
    ModelRenderer Shape48;
    ModelRenderer Shape49;
  
  public ModelSphere()
  {
    textureWidth = 32;
    textureHeight = 512;
    
      Shape1 = new ModelRenderer(this, 0, 0);
      Shape1.addBox(-1F, 0F, 0F, 5, 1, 1);
      Shape1.setRotationPoint(-2F, 22F, 0F);
      Shape1.setTextureSize(32, 512);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
      Shape2 = new ModelRenderer(this, 0, 0);
      Shape2.addBox(0F, 0F, 0F, 1, 1, 2);
      Shape2.setRotationPoint(-1F, 22F, 1F);
      Shape2.setTextureSize(32, 512);
      Shape2.mirror = true;
      setRotation(Shape2, 0F, 0F, 0F);
      Shape3 = new ModelRenderer(this, 0, 0);
      Shape3.addBox(0F, 0F, 0F, 1, 1, 2);
      Shape3.setRotationPoint(-1F, 22F, -2F);
      Shape3.setTextureSize(32, 512);
      Shape3.mirror = true;
      setRotation(Shape3, 0F, 0F, 0F);
      Shape4 = new ModelRenderer(this, 0, 0);
      Shape4.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape4.setRotationPoint(0F, 22F, 1F);
      Shape4.setTextureSize(32, 512);
      Shape4.mirror = true;
      setRotation(Shape4, 0F, 0F, 0F);
      Shape5 = new ModelRenderer(this, 0, 0);
      Shape5.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape5.setRotationPoint(0F, 22F, -1F);
      Shape5.setTextureSize(32, 512);
      Shape5.mirror = true;
      setRotation(Shape5, 0F, 0F, 0F);
      Shape6 = new ModelRenderer(this, 0, 0);
      Shape6.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape6.setRotationPoint(-2F, 22F, 1F);
      Shape6.setTextureSize(32, 512);
      Shape6.mirror = true;
      setRotation(Shape6, 0F, 0F, 0F);
      Shape7 = new ModelRenderer(this, 0, 0);
      Shape7.addBox(0F, 0F, -1F, 1, 1, 1);
      Shape7.setRotationPoint(-2F, 22F, 0F);
      Shape7.setTextureSize(32, 512);
      Shape7.mirror = true;
      setRotation(Shape7, 0F, 0F, 0F);
      Shape8 = new ModelRenderer(this, 0, 0);
      Shape8.addBox(0F, 0F, 0F, 5, 1, 1);
      Shape8.setRotationPoint(-3F, 10F, 0F);
      Shape8.setTextureSize(32, 512);
      Shape8.mirror = true;
      setRotation(Shape8, 0F, 0F, 0F);
      Shape9 = new ModelRenderer(this, 0, 0);
      Shape9.addBox(0F, 0F, 0F, 1, 1, 2);
      Shape9.setRotationPoint(-1F, 10F, 1F);
      Shape9.setTextureSize(32, 512);
      Shape9.mirror = true;
      setRotation(Shape9, 0F, 0F, 0F);
      Shape10 = new ModelRenderer(this, 0, 0);
      Shape10.addBox(0F, 0F, 0F, 1, 1, 2);
      Shape10.setRotationPoint(-1F, 10F, -2F);
      Shape10.setTextureSize(32, 512);
      Shape10.mirror = true;
      setRotation(Shape10, 0F, 0F, 0F);
      Shape11 = new ModelRenderer(this, 0, 0);
      Shape11.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape11.setRotationPoint(0F, 10F, -1F);
      Shape11.setTextureSize(32, 512);
      Shape11.mirror = true;
      setRotation(Shape11, 0F, 0F, 0F);
      Shape12 = new ModelRenderer(this, 0, 0);
      Shape12.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape12.setRotationPoint(0F, 10F, 1F);
      Shape12.setTextureSize(32, 512);
      Shape12.mirror = true;
      setRotation(Shape12, 0F, 0F, 0F);
      Shape13 = new ModelRenderer(this, 0, 0);
      Shape13.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape13.setRotationPoint(-2F, 10F, 1F);
      Shape13.setTextureSize(32, 512);
      Shape13.mirror = true;
      setRotation(Shape13, 0F, 0F, 0F);
      Shape14 = new ModelRenderer(this, 0, 0);
      Shape14.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape14.setRotationPoint(-2F, 10F, -1F);
      Shape14.setTextureSize(32, 512);
      Shape14.mirror = true;
      setRotation(Shape14, 0F, 0F, 0F);
      Shape15 = new ModelRenderer(this, 0, 0);
      Shape15.addBox(0F, 0F, 0F, 1, 1, 5);
      Shape15.setRotationPoint(5F, 16F, -2F);
      Shape15.setTextureSize(32, 512);
      Shape15.mirror = true;
      setRotation(Shape15, 0F, 0F, 0F);
      Shape16 = new ModelRenderer(this, 0, 0);
      Shape16.addBox(0F, 0F, 0F, 1, 2, 1);
      Shape16.setRotationPoint(5F, 14F, 0F);
      Shape16.setTextureSize(32, 512);
      Shape16.mirror = true;
      setRotation(Shape16, 0F, 0F, 0F);
      Shape17 = new ModelRenderer(this, 0, 0);
      Shape17.addBox(0F, 0F, 0F, 1, 2, 1);
      Shape17.setRotationPoint(5F, 17F, 0F);
      Shape17.setTextureSize(32, 512);
      Shape17.mirror = true;
      setRotation(Shape17, 0F, 0F, 0F);
      Shape18 = new ModelRenderer(this, 0, 0);
      Shape18.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape18.setRotationPoint(5F, 15F, 1F);
      Shape18.setTextureSize(32, 512);
      Shape18.mirror = true;
      setRotation(Shape18, 0F, 0F, 0F);
      Shape19 = new ModelRenderer(this, 0, 0);
      Shape19.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape19.setRotationPoint(5F, 15F, -1F);
      Shape19.setTextureSize(32, 512);
      Shape19.mirror = true;
      setRotation(Shape19, 0F, 0F, 0F);
      Shape20 = new ModelRenderer(this, 0, 0);
      Shape20.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape20.setRotationPoint(5F, 17F, 1F);
      Shape20.setTextureSize(32, 512);
      Shape20.mirror = true;
      setRotation(Shape20, 0F, 0F, 0F);
      Shape21 = new ModelRenderer(this, 0, 0);
      Shape21.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape21.setRotationPoint(5F, 17F, -1F);
      Shape21.setTextureSize(32, 512);
      Shape21.mirror = true;
      setRotation(Shape21, 0F, 0F, 0F);
      Shape22 = new ModelRenderer(this, 0, 0);
      Shape22.addBox(0F, 0F, 0F, 5, 1, 1);
      Shape22.setRotationPoint(-3F, 16F, -6F);
      Shape22.setTextureSize(32, 512);
      Shape22.mirror = true;
      setRotation(Shape22, 0F, 0F, 0F);
      Shape23 = new ModelRenderer(this, 0, 0);
      Shape23.addBox(0F, 0F, 0F, 1, 2, 1);
      Shape23.setRotationPoint(-1F, 14F, -6F);
      Shape23.setTextureSize(32, 512);
      Shape23.mirror = true;
      setRotation(Shape23, 0F, 0F, 0F);
      Shape24 = new ModelRenderer(this, 0, 0);
      Shape24.addBox(0F, 0F, 0F, 1, 2, 1);
      Shape24.setRotationPoint(-1F, 17F, -6F);
      Shape24.setTextureSize(32, 512);
      Shape24.mirror = true;
      setRotation(Shape24, 0F, 0F, 0F);
      Shape25 = new ModelRenderer(this, 0, 0);
      Shape25.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape25.setRotationPoint(0F, 17F, -6F);
      Shape25.setTextureSize(32, 512);
      Shape25.mirror = true;
      setRotation(Shape25, 0F, 0F, 0F);
      Shape26 = new ModelRenderer(this, 0, 0);
      Shape26.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape26.setRotationPoint(0F, 15F, -6F);
      Shape26.setTextureSize(32, 512);
      Shape26.mirror = true;
      setRotation(Shape26, 0F, 0F, 0F);
      Shape27 = new ModelRenderer(this, 0, 0);
      Shape27.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape27.setRotationPoint(-2F, 15F, -6F);
      Shape27.setTextureSize(32, 512);
      Shape27.mirror = true;
      setRotation(Shape27, 0F, 0F, 0F);
      Shape28 = new ModelRenderer(this, 0, 0);
      Shape28.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape28.setRotationPoint(-2F, 17F, -6F);
      Shape28.setTextureSize(32, 512);
      Shape28.mirror = true;
      setRotation(Shape28, 0F, 0F, 0F);
      Shape29 = new ModelRenderer(this, 0, 0);
      Shape29.addBox(0F, 0F, 0F, 5, 1, 1);
      Shape29.setRotationPoint(-3F, 16F, 6F);
      Shape29.setTextureSize(32, 512);
      Shape29.mirror = true;
      setRotation(Shape29, 0F, 0F, 0F);
      Shape30 = new ModelRenderer(this, 0, 0);
      Shape30.addBox(0F, 0F, 0F, 1, 2, 1);
      Shape30.setRotationPoint(-1F, 14F, 6F);
      Shape30.setTextureSize(32, 512);
      Shape30.mirror = true;
      setRotation(Shape30, 0F, 0F, 0F);
      Shape31 = new ModelRenderer(this, 0, 0);
      Shape31.addBox(0F, 0F, 0F, 1, 2, 1);
      Shape31.setRotationPoint(-1F, 17F, 6F);
      Shape31.setTextureSize(32, 512);
      Shape31.mirror = true;
      setRotation(Shape31, 0F, 0F, 0F);
      Shape32 = new ModelRenderer(this, 0, 0);
      Shape32.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape32.setRotationPoint(0F, 15F, 6F);
      Shape32.setTextureSize(32, 512);
      Shape32.mirror = true;
      setRotation(Shape32, 0F, 0F, 0F);
      Shape33 = new ModelRenderer(this, 0, 0);
      Shape33.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape33.setRotationPoint(-2F, 17F, 6F);
      Shape33.setTextureSize(32, 512);
      Shape33.mirror = true;
      setRotation(Shape33, 0F, 0F, 0F);
      Shape34 = new ModelRenderer(this, 0, 0);
      Shape34.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape34.setRotationPoint(-2F, 15F, 6F);
      Shape34.setTextureSize(32, 512);
      Shape34.mirror = true;
      setRotation(Shape34, 0F, 0F, 0F);
      Shape35 = new ModelRenderer(this, 0, 0);
      Shape35.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape35.setRotationPoint(0F, 17F, 6F);
      Shape35.setTextureSize(32, 512);
      Shape35.mirror = true;
      setRotation(Shape35, 0F, 0F, 0F);
      Shape36 = new ModelRenderer(this, 0, 0);
      Shape36.addBox(0F, 0F, 0F, 1, 1, 5);
      Shape36.setRotationPoint(-7F, 16F, -2F);
      Shape36.setTextureSize(32, 512);
      Shape36.mirror = true;
      setRotation(Shape36, 0F, 0F, 0F);
      Shape37 = new ModelRenderer(this, 0, 0);
      Shape37.addBox(0F, 0F, 0F, 1, 2, 1);
      Shape37.setRotationPoint(-7F, 17F, 0F);
      Shape37.setTextureSize(32, 512);
      Shape37.mirror = true;
      setRotation(Shape37, 0F, 0F, 0F);
      Shape38 = new ModelRenderer(this, 0, 0);
      Shape38.addBox(0F, 0F, 0F, 1, 2, 1);
      Shape38.setRotationPoint(-7F, 14F, 0F);
      Shape38.setTextureSize(32, 512);
      Shape38.mirror = true;
      setRotation(Shape38, 0F, 0F, 0F);
      Shape39 = new ModelRenderer(this, 0, 0);
      Shape39.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape39.setRotationPoint(-7F, 17F, -1F);
      Shape39.setTextureSize(32, 512);
      Shape39.mirror = true;
      setRotation(Shape39, 0F, 0F, 0F);
      Shape40 = new ModelRenderer(this, 0, 0);
      Shape40.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape40.setRotationPoint(-7F, 15F, -1F);
      Shape40.setTextureSize(32, 512);
      Shape40.mirror = true;
      setRotation(Shape40, 0F, 0F, 0F);
      Shape41 = new ModelRenderer(this, 0, 0);
      Shape41.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape41.setRotationPoint(-7F, 17F, 1F);
      Shape41.setTextureSize(32, 512);
      Shape41.mirror = true;
      setRotation(Shape41, 0F, 0F, 0F);
      Shape42 = new ModelRenderer(this, 0, 0);
      Shape42.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape42.setRotationPoint(-7F, 15F, 1F);
      Shape42.setTextureSize(32, 512);
      Shape42.mirror = true;
      setRotation(Shape42, 0F, 0F, 0F);
      Shape43 = new ModelRenderer(this, 0, 0);
      Shape43.addBox(0F, 0F, 0F, 7, 1, 7);
      Shape43.setRotationPoint(-4F, 21F, -3F);
      Shape43.setTextureSize(32, 512);
      Shape43.mirror = true;
      setRotation(Shape43, 0F, 0F, 0F);
      Shape44 = new ModelRenderer(this, 0, 0);
      Shape44.addBox(0F, 0F, 0F, 7, 1, 7);
      Shape44.setRotationPoint(-4F, 11F, -3F);
      Shape44.setTextureSize(32, 512);
      Shape44.mirror = true;
      setRotation(Shape44, 0F, 0F, 0F);
      Shape45 = new ModelRenderer(this, 0, 0);
      Shape45.addBox(0F, 0F, 0F, 1, 7, 7);
      Shape45.setRotationPoint(4F, 13F, -3F);
      Shape45.setTextureSize(32, 512);
      Shape45.mirror = true;
      setRotation(Shape45, 0F, 0F, 0F);
      Shape46 = new ModelRenderer(this, 0, 0);
      Shape46.addBox(0F, 0F, 0F, 1, 7, 7);
      Shape46.setRotationPoint(-6F, 13F, -3F);
      Shape46.setTextureSize(32, 512);
      Shape46.mirror = true;
      setRotation(Shape46, 0F, 0F, 0F);
      Shape47 = new ModelRenderer(this, 0, 0);
      Shape47.addBox(0F, 0F, 0F, 7, 7, 1);
      Shape47.setRotationPoint(-4F, 13F, 5F);
      Shape47.setTextureSize(32, 512);
      Shape47.mirror = true;
      setRotation(Shape47, 0F, 0F, 0F);
      Shape48 = new ModelRenderer(this, 0, 0);
      Shape48.addBox(0F, 0F, 0F, 7, 7, 1);
      Shape48.setRotationPoint(-4F, 13F, -5F);
      Shape48.setTextureSize(32, 512);
      Shape48.mirror = true;
      setRotation(Shape48, 0F, 0F, 0F);
      Shape49 = new ModelRenderer(this, 0, 0);
      Shape49.addBox(0F, 0F, 0F, 9, 9, 9);
      Shape49.setRotationPoint(-5F, 12F, -4F);
      Shape49.setTextureSize(32, 512);
      Shape49.mirror = true;
      setRotation(Shape49, 0F, 0F, 0F);
  }
  
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    Shape1.render(f5);
    Shape2.render(f5);
    Shape3.render(f5);
    Shape4.render(f5);
    Shape5.render(f5);
    Shape6.render(f5);
    Shape7.render(f5);
    Shape8.render(f5);
    Shape9.render(f5);
    Shape10.render(f5);
    Shape11.render(f5);
    Shape12.render(f5);
    Shape13.render(f5);
    Shape14.render(f5);
    Shape15.render(f5);
    Shape16.render(f5);
    Shape17.render(f5);
    Shape18.render(f5);
    Shape19.render(f5);
    Shape20.render(f5);
    Shape21.render(f5);
    Shape22.render(f5);
    Shape23.render(f5);
    Shape24.render(f5);
    Shape25.render(f5);
    Shape26.render(f5);
    Shape27.render(f5);
    Shape28.render(f5);
    Shape29.render(f5);
    Shape30.render(f5);
    Shape31.render(f5);
    Shape32.render(f5);
    Shape33.render(f5);
    Shape34.render(f5);
    Shape35.render(f5);
    Shape36.render(f5);
    Shape37.render(f5);
    Shape38.render(f5);
    Shape39.render(f5);
    Shape40.render(f5);
    Shape41.render(f5);
    Shape42.render(f5);
    Shape43.render(f5);
    Shape44.render(f5);
    Shape45.render(f5);
    Shape46.render(f5);
    Shape47.render(f5);
    Shape48.render(f5);
    Shape49.render(f5);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  }
}

 

 

RenderSphere:

 

package exampled.modinfo.entity.render;

import exampled.modinfo.entity.EntitySphere;
import exampled.modinfo.entity.model.ModelSphere;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;


@SideOnly(Side.CLIENT)
public class RenderSphere extends Render
{
    protected ModelSphere model;
    
    public RenderSphere(RenderManager renderManager)
    {
        super(renderManager);
        this.model = new ModelSphere();
    }
    
    public void doRender(EntitySphere entity, double x, double y, double z, float f, float partialTicks)
    {
        GlStateManager.pushMatrix();
        this.bindEntityTexture(entity);
        GlStateManager.translate(x, y - 0.4734, z);
        GlStateManager.rotate(entity.rotationYaw, 1, 80, 1);
        
        if(model.shouldBeTransparent())
        {
            GlStateManager.enableNormalize();
            GlStateManager.enableBlend();
            GlStateManager.blendFunc(770, 771);
            model.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
            GlStateManager.disableBlend();
            GlStateManager.disableNormalize();
        }
        else
            model.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
        
        GlStateManager.popMatrix();
        super.doRender(entity, x, y, z, f, partialTicks);
    }
    
    protected ResourceLocation getTexture(EntitySphere entity)
    {
        return model.getTexture();
    }
    
    protected ResourceLocation getEntityTexture(Entity entity)
    {
        return this.getTexture((EntitySphere)entity);
    }
    public void doRender(Entity entity, double x, double y, double z, float f, float partialTicks)
    {
        this.doRender((EntitySphere)entity, x, y, z, f, partialTicks);
    }
}

 

 

ExampledEntities:

 

package exampled.modinfo.init;

import exampled.modinfo.Exampled;
import exampled.modinfo.entity.EntitySphere;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.EntityRegistry;

public class ExampledEntities
{
private static int id = 0;

public static void registerEntities(ResourceLocation rsrcl) {
	// TODO Auto-generated method stub
	register( rsrcl, EntitySphere.class, "sphere");
}

private static void register(ResourceLocation rsrcl, Class cls, String name)
{
	EntityRegistry.registerModEntity( rsrcl, cls, name, id++, Exampled.getInstance(), 128, 214, true);
}	
}

 

 

ExampledItems:

 

package exampled.modinfo.init;

import exampled.modinfo.ModCreativeTabs;
import exampled.modinfo.Reference;
import exampled.modinfo.item.ItemSphere;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ExampledItems
{
public static Item SPHERE;

public static void init()
{
	Item item = (new ItemBucket(Blocks.AIR)).setUnlocalizedName("bucket").setMaxStackSize(16);
	SPHERE = new ItemSphere().setUnlocalizedName("sphere");
}
public static void register()
{
	GameRegistry.register(SPHERE.setRegistryName ("sphere"));
}
public static void registerRenders()
{
	registerRender(SPHERE);
}
private static void registerRender(Item item)
{
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
}

 

 

ItemSphere:

 

package exampled.modinfo.item;

import exampled.modinfo.ModCreativeTabs;
import exampled.modinfo.entity.EntitySphere;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundCategory;
import net.minecraft.world.World;

public class ItemSphere extends Item
{
    public ItemSphere()
    {
    	this.maxStackSize = 16;
    	this.setCreativeTab(ModCreativeTabs.example_tab);
    }

    public ActionResult<ItemStack> onItemRightClick(World itemStackIn, EntityPlayer worldIn, EnumHand playerIn)
    {
        ItemStack itemstack = worldIn.getHeldItem(playerIn);

        if (!worldIn.capabilities.isCreativeMode)
        {
            itemstack.func_190918_g(1);
        }

        itemStackIn.playSound((EntityPlayer)null, worldIn.posX, worldIn.posY, worldIn.posZ, SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));

        if (!itemStackIn.isRemote)
        {
            EntitySphere entitythrowable = new EntitySphere(itemStackIn, worldIn);
            entitythrowable.setHeadingFromThrower(worldIn, worldIn.rotationPitch, worldIn.rotationYaw, 0.0F, 1.5F, 1.0F);
            itemStackIn.spawnEntityInWorld(entitythrowable);
        }

        worldIn.addStat(StatList.getObjectUseStats(this));
        return new ActionResult(EnumActionResult.SUCCESS, itemstack);
    }
}

 

 

ClientProxy:

 

package exampled.modinfo.proxy;


import exampled.modinfo.entity.EntitySphere;
import exampled.modinfo.entity.render.RenderSphere;
import exampled.modinfo.init.ExampledItems;
import net.minecraftforge.fml.client.registry.RenderingRegistry;

public class ClientProxy extends CommonProxy
{
@Override
public void preInit()
{
	super.preInit();
	RenderingRegistry.registerEntityRenderingHandler(EntitySphere.class, RenderSphere::new);
}	
@Override
public void registerRenders()
{
	ExampledItems.registerRenders();
}
}

 

 

CommonProxy:

 

package exampled.modinfo.proxy;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

public class CommonProxy implements IGuiHandler
{
    public void registerKeybindings()
    { 	
    }
public void registerRenders()
{		
}	
public void preInit()
{		
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
	return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
        return null;
}
}

 

 

 

I am unable to resolve this, I end up hitting an area where I get no red and it displays no errors and I get crashed... That's about as far as I've got :\. I got it to load one time but the entity was invisible and how I got that far escapes me now...

Posted

You forgot the most important part: the crash.

 

Ok, it did give me a crash report, I just had to find it:

---- Minecraft Crash Report ----
// Daisy, daisy...

Time: 11/19/16 2:36 PM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from change_this_to_set_mod_name (exampled)
Caused by: java.lang.NullPointerException
at net.minecraftforge.fml.common.registry.IForgeRegistryEntry$Impl.setRegistryName(IForgeRegistryEntry.java:90)
at net.minecraftforge.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:181)
at net.minecraftforge.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:149)
at exampled.modinfo.init.ExampledEntities.register(ExampledEntities.java:19)
at exampled.modinfo.init.ExampledEntities.registerEntities(ExampledEntities.java:14)
at exampled.modinfo.Exampled.preInit(Exampled.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:602)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:243)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:221)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:145)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:614)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:263)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:476)
at net.minecraft.client.Minecraft.run(Minecraft.java:385)
at net.minecraft.client.main.Main.main(Main.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
Minecraft Version: 1.11
Operating System: Windows Vista (x86) version 6.0
Java Version: 1.8.0_111, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
Memory: 744004848 bytes (709 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP 9.35 Powered by Forge 13.19.0.2153 4 mods loaded, 4 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCH	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
UCH	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11-13.19.0.2153.jar) 
UCH	forge{13.19.0.2153} [Minecraft Forge] (forgeSrc-1.11-13.19.0.2153.jar) 
UCE	exampled{1.0} [change_this_to_set_mod_name] (bin) 
Loaded coremods (and transformers): 
GL info: ' Vendor: 'ATI Technologies Inc.' Version: '3.3.11672 Compatibility Profile Context' Renderer: 'ATI Radeon HD 2400 PRO'

Posted

You never initialize the

Exampled.rsrcl

field, hence it's value is

null

. You then pass it on to

ExampledEntities.registerEntities

and

ExampledEntities.register

, where you pass it to

EntityRegistry.registerModEntity

. You cannot use

null

as the registry name for an entity, provide a useful registry name, like for items and blocks.

 

Can you give me an example of this, please?

initialize the

Exampled.rsrcl

 

:| I feel bad for asking :\

Posted

You never initialize the

Exampled.rsrcl

field, hence it's value is

null

. You then pass it on to

ExampledEntities.registerEntities

and

ExampledEntities.register

, where you pass it to

EntityRegistry.registerModEntity

. You cannot use

null

as the registry name for an entity, provide a useful registry name, like for items and blocks.

 

Can you give me an example of this, please?

initialize the

Exampled.rsrcl

 

:| I feel bad for asking :\

rsrcl = new ResourceLocation(modid, name);

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

I almost hate this. (Ok, I do hate this.)

 

This sucks... and I still can't get it working.

 

{
private static int id = 0;

rsrcl = new ResourceLocation(ResourceLocation rsrcl, Class cls, String name);
{
	EntityRegistry.registerModEntity( rsrcl1, cls, name, id++, Exampled.getInstance(), 128, 214, true);
}

public static void registerEntities(ResourceLocation rsrcl) {
	// TODO Auto-generated method stub
	register( rsrcl, EntitySphere.class, "sphere");
}

}

 

 

Least now I know where its all screwed up.

Every time there's an update I get to start allll over again -.-

Posted

What in the heck are you doing? Just pass in a

ResourceLocation

. Don't put it in a static field or anything. Like with blocks. Or items.

 

I don't know how man!

 

"like for items and blocks."

 

I feel like bashing my head as hard as I can into this keyboard atm.

Posted

What in the heck are you doing? Just pass in a

ResourceLocation

. Don't put it in a static field or anything. Like with blocks. Or items.

 

I don't know how man!

 

"like for items and blocks."

 

I feel like bashing my head as hard as I can into this keyboard atm.

register(new ResourceLocation(modid, name), EntitySphere.class, "sphere");

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

Dude...

There is ONE new argument as opposed to before. You pass in a

ResourceLocation

there. Everything else stays the same. This is not hard. And if it is, you need to go learn programming.

 

Yeah, and I don't know how to use it, and it totally goes against everything I had before.

Posted

what is supposed to go into name here?

 

public static void registerEntities(ResourceLocation rsrcl) {

// TODO Auto-generated method stub

register(new ResourceLocation(id++, name), EntitySphere.class, "sphere");

}

Posted

Why on earth are you using id++ as your mod ID?!? Do you know what a ResourceLocation is? The first parameter should be your mod ID and the second parameter should be the name of your entity, which can be the same as the String you're passing to register for simplicity's sake.

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Posted

I done said, I have no idea how to use resourcelocation at all.

 

I have not one ioda of a clue of what the flip I'm doin.

 

I'm just a normal guy, and I've managed to keep the project alive for a year. And I would like to keep it going.

Posted

I done said, I have no idea how to use resourcelocation at all.

 

I have not one ioda of a clue of what the flip I'm doin.

 

I'm just a normal guy, and I've managed to keep the project alive for a year. And I would like to keep it going.

Here is a hint if you do not know how to create an instance of a class: look at the classes constructor.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

ResourceLocation is used incredibly frequently in Minecraft/Forge/mods, it's used all over the place as a general mod ID + name identifier. If you can't look at the code for the class itself and the contexts in which it's used and understand it, you should probably spend some more time learning Java.

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Posted

I done said, I have no idea how to use resourcelocation at all.

 

I have not one ioda of a clue of what the flip I'm doin.

 

I'm just a normal guy, and I've managed to keep the project alive for a year. And I would like to keep it going.

Here is a hint if you do not know how to create an instance of a class: look at the classes constructor.

 

as I did here:

private static ResourceLocation rsrcl;

I also did an instance for the creative tab.

 

or maybe not.... *sigh* I'm just going to go to bed and give up for now...

 

May be the end of the basic elements. dunno. I guess I'll find out every update.

Posted

as I did here:

private static ResourceLocation rsrcl;

I also did an instance for the creative tab.

 

That is not instantiation, that is field creation. Instantiation looks like this:

new ResourceLocation("minecraft:steak")

 

Oracle has a very good set of tutorials on the java basics. I've linked them below:

https://docs.oracle.com/javase/tutorial/java/concepts/

https://docs.oracle.com/javase/tutorial/java/nutsandbolts/

https://docs.oracle.com/javase/tutorial/java/javaOO/

Posted

I prefer calling it "declaration" as in "I declare that this variable exists" vs. "definition" as in "this is what this variable is."

Instantiation need not be part of a variable definition, but often is. (e.g. it can be passed as a method parameter instead, or ignored (cough, dead code, cough)).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Awake again and back at it. Would almost just pay someone 5-10$ for an example snowball mod...

 

 

I don't like this part of modding. I like to do artwork. This part is miserable... and terrible, every aspect of it.

 

No -entities can be registered now heads up.

No -here is an example entity.

No -here's what changed note.

 

There's not any documentation on any of this stuff and its raw.

since waddles and better than bunnies do things in the way they do them I really don't have any code example to work off of. So I'm stuck and I'm just not going to continue til I can find an unfrustrating way of doing this.

 

either way I'm tired of getting screwed every update, and having to rewrite everything. Its not fun.

 

I have spent weeks solid watching newbostons videos. and I have studied java tutorials on oracle.

The issue is not with knowing java. the issue is with minecraft and how everything is all tangled up.

Or the documentation of changes. How to apply these changes. and how to change accordingly with an example without someone claiming its wrong to share code with someone. (because that's bs)

 

You can't know if you don't know and can't see it. There is a complete lack of community cooperation. A house divided does not stand, the same as one that is concealed.

 

You can make a block out of void utils for example and it wont have a texture, nor does it give you hints as to how to set a texture, therefore it fails as a block example. It also leaves out a lang file example.

 

The end result is a no textured block with a funky name. This is what I am referring to mentioning concealed above.

but, "that's the right way to do it". <--- I completely disagree.

 

clientSideOnly = false,

serverSideOnly = false,

 

wtf is this? How about a block example that actually works and is functional? Or a public list of changes, with a small explanation of how to interpret them.

 

Its like going into a store and breaking something, then leaving without paying for it.

Posted

Awake again and back at it. Would almost just pay someone 5-10$ for an example snowball mod...

This isn't going to be enough for anyone.

 

I don't like this part of modding. I like to do artwork. This part is miserable... and terrible, every aspect of it.

Then go make some art, or a ResourcePack or something. If you hate programming, modding isn't made for you.

 

No -entities can be registered now heads up.

If you take a look at the Forge changelog every day, you should've noticed that.

 

No -here is an example entity.

The vanilla code has enough example entity code.

 

No -here's what changed note.

Again, in the Forge changelog are a lot of clues as to what has changed.

 

There's not any documentation on any of this stuff and its raw.

mcforge.readthedocs.io

 

I'm tired of getting screwed every update, and having to rewrite everything. Its not fun.

No it isn't. That's just the way it is when modding a game without an official API.

 

I have spent weeks solid watching newbostons videos. and I have studied java tutorials on oracle.

 

Therein lies your issue. Just watching videos and reading stuff from the internet is not enough to learn Java good enough to make Minecraft mods. You should first try to make something in Java outside of Minecraft. This will actually learn you the basics of Java.

 

The issue is not with knowing java. the issue is with minecraft and how everything is all tangled up.

No, the issue isn't Minecraft, it's your Java that's the issue. You showed you don't know how to work with objects (
ResourceLocation

), how to define them and how to instantiate them, what static means and how to use it. There's a lot more I can go over, but I'll spare you the details.

 

with an example without someone claiming its wrong to share code with someone. (because that's bs)

This is because there are people that when someone asks for help, they give fully-working code, which they copy-paste in their own code and call it done. And then 2 days later we see a similar issue by the same user because the copy-pasted code isn't working, and he doesn't understand how it works.

 

There is a complete lack of community cooperation

Then what is this forum for?

 

You can make a block out of void utils for example and it wont have a texture, nor does it give you hints as to how to set a texture, therefore it fails as a block example. It also leaves out a lang file example.

There are hundreds if not thousands of threads on this forum that help other people with issues with textures, which you can take a look at. If they don't help, make a new thread here. Same applies for
.lang

files.

 

but, "that's the right way to do it". <--- I completely disagree.

Please, if you do, state why.

 

clientSideOnly = false,

serverSideOnly = false,

 

wtf is this?

From the @Mod documentation:

/**
     * If true, this mod will not be loaded on the Dedicated Server environment.
     * Will crash if both serverSideOnly and clientSideOnly are set to true.
     */
    boolean clientSideOnly() default false;

    /**
     * If true, this mod will not be loaded on the Client environment.
     * Will crash if both serverSideOnly and clientSideOnly are set to true.
     */
    boolean serverSideOnly() default false;

 

How about a block example that actually works and is functional?

Vanilla has tons of them.

 

Its like going into a store and breaking something, then leaving without paying for it.

Except the store is Mojang's store, and if they break it they don't have to pay for it, as it is their own.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Awake again and back at it. Would almost just pay someone 5-10$ for an example snowball mod...

This isn't going to be enough for anyone.

-I shouldn't have to pay to know how to make a snowball anyways.

 

I don't like this part of modding. I like to do artwork. This part is miserable... and terrible, every aspect of it.

Then go make some art, or a ResourcePack or something. If you hate programming, modding isn't made for you.

Well its not that my entities and models and eveything else is wrong, its only the way it is registered.

 

No -entities can be registered now heads up.

If you take a look at the Forge changelog every day, you should've noticed that.

Yeah, on initial release of first draft you could not register entities.

 

No -here is an example entity.

The vanilla code has enough example entity code.

I have plenty of working entities myeself.

 

No -here's what changed note.

Again, in the Forge changelog are a lot of clues as to what has changed.

I'm talking about things more specifically like a note stating that itemstack will no longer work for things would have been nice on the first release of 1.11 forge.

 

There's not any documentation on any of this stuff and its raw.

mcforge.readthedocs.io

have read it several times.

 

 

I'm tired of getting screwed every update, and having to rewrite everything. Its not fun.

No it isn't. That's just the way it is when modding a game without an official API.

its extremely discouraging.

 

I have spent weeks solid watching newbostons videos. and I have studied java tutorials on oracle.

 

Therein lies your issue. Just watching videos and reading stuff from the internet is not enough to learn Java good enough to make Minecraft mods. You should first try to make something in Java outside of Minecraft. This will actually learn you the basics of Java.

I learned java by playing minecraft and using forge, a year ago I knew absolutely nothing short of modifying black & white maps in notepad.

 

The issue is not with knowing java. the issue is with minecraft and how everything is all tangled up.

No, the issue isn't Minecraft, it's your Java that's the issue. You showed you don't know how to work with objects (
ResourceLocation

), how to define them and how to instantiate them, what static means and how to use it. There's a lot more I can go over, but I'll spare you the details.

I know public static is that it can be seen by other files, and private static is so that it cannot be seen by other files. It is static because it can be seen in other places.

 

with an example without someone claiming its wrong to share code with someone. (because that's bs)

This is because there are people that when someone asks for help, they give fully-working code, which they copy-paste in their own code and call it done. And then 2 days later we see a similar issue by the same user because the copy-pasted code isn't working, and he doesn't understand how it works.

 

There is a complete lack of community cooperation

Then what is this forum for?

from what I've experienced scoffing or insulting people based on how ignorant you believe they are.

 

You can make a block out of void utils for example and it wont have a texture, nor does it give you hints as to how to set a texture, therefore it fails as a block example. It also leaves out a lang file example.

There are hundreds if not thousands of threads on this forum that help other people with issues with textures, which you can take a look at. If they don't help, make a new thread here. Same applies for
.lang

files.

 

but, "that's the right way to do it". <--- I completely disagree.

Please, if you do, state why.

This frustrates the end user in the creating of their first block and makes them miserable (least I felt a bit miserable after wasting hours of my life just to have a texturless ugly looking block that is generated by minecraft.)

 

clientSideOnly = false,

serverSideOnly = false,

 

wtf is this?

From the @Mod documentation:

/**
     * If true, this mod will not be loaded on the Dedicated Server environment.
     * Will crash if both serverSideOnly and clientSideOnly are set to true.
     */
    boolean clientSideOnly() default false;

    /**
     * If true, this mod will not be loaded on the Client environment.
     * Will crash if both serverSideOnly and clientSideOnly are set to true.
     */
    boolean serverSideOnly() default false;

 

How about a block example that actually works and is functional?

Vanilla has tons of them.

But the reality is, is that forge doesn't, there should be a working block example *at least in the documentation.

Instead of going, here's how your supposed to do it, but it doesn't work, HAHA. Then leaving you to the community to be insulted.

 

Its like going into a store and breaking something, then leaving without paying for it.

Except the store is Mojang's store, and if they break it they don't have to pay for it, as it is their own.

Except I programmed a store, and I put things in my store, and someone come into my store and broke my stuff without giving me some super glue to fix it with.

Posted

This isn't going to be enough for anyone.

-I shouldn't have to pay to know how to make a snowball anyways.

 

Then go make some art, or a ResourcePack or something. If you hate programming, modding isn't made for you.

Well its not that my entities and models and eveything else is wrong, its only the way it is registered.

 

If you take a look at the Forge changelog every day, you should've noticed that.

Yeah, on initial release of first draft you could not register entities.

 

The vanilla code has enough example entity code.

I have plenty of working entities myeself.

 

Again, in the Forge changelog are a lot of clues as to what has changed.

I'm talking about things more specifically like a note stating that itemstack will no longer work for things would have been nice on the first release of 1.11 forge.

 

mcforge.readthedocs.io

Have read it several times. Does not show you how to use java 8 with forge and eclipse.

 

 

No it isn't. That's just the way it is when modding a game without an official API.

its extremely discouraging.

 

 

Therein lies your issue. Just watching videos and reading stuff from the internet is not enough to learn Java good enough to make Minecraft mods. You should first try to make something in Java outside of Minecraft. This will actually learn you the basics of Java.

I learned java by playing minecraft and using forge, a year ago I knew absolutely nothing short of modifying black & white maps in notepad. I did learn how to do hello world, and get it to copy and respond to me though.

 

No, the issue isn't Minecraft, it's your Java that's the issue. You showed you don't know how to work with objects (

ResourceLocation

), how to define them and how to instantiate them, what static means and how to use it. There's a lot more I can go over, but I'll spare you the details.

I know public static is that it can be seen by other files, and private static is so that it cannot be seen by other files. It is static because it can be seen in other places within the same file.

 

This is because there are people that when someone asks for help, they give fully-working code, which they copy-paste in their own code and call it done. And then 2 days later we see a similar issue by the same user because the copy-pasted code isn't working, and he doesn't understand how it works.

If copy and pasting gives someone the base to interpret how to make what their doing functional that's good.

Interpretation though, at least the possibility for such would be possible.

 

Then what is this forum for?

from what I've experienced scoffing or insulting people based on how ignorant you believe they are. Or giving people small bits of code to work with and laughing as they fail.

 

There are hundreds if not thousands of threads on this forum that help other people with issues with textures, which you can take a look at. If they don't help, make a new thread here. Same applies for

.lang

files.

This frustrates the end user in the creating of their first block and makes them miserable (least I felt a bit miserable after wasting hours of my life just to have a textureless ugly looking block that is *produced by minecraft itself*.) -makes things hard on end user. -the wrong way -the block would not exist if not for mojang because technically it is/isn't a block used to cover bad or missing textures in a resourcepack, in other words its vanilla and coremods are not supported here.

 

"Here's the right way to do it"

"Coremods are not supported here, thread locked"

 

From the @Mod documentation:

/**
     * If true, this mod will not be loaded on the Dedicated Server environment.
     * Will crash if both serverSideOnly and clientSideOnly are set to true.
     */
    boolean clientSideOnly() default false;

    /**
     * If true, this mod will not be loaded on the Client environment.
     * Will crash if both serverSideOnly and clientSideOnly are set to true.
     */
    boolean serverSideOnly() default false;

Vanilla has tons of them.

But the reality is, is that forge doesn't, there should be a working block example *at least in the documentation.

Instead of going, here's how your supposed to do it, but it doesn't work, HAHA. Then leaving you to the community to be insulted.

 

 

Except I programmed a store, and I put things in my store, and someone come into my store and broke my stuff without giving me some super glue to fix it with. actually its more like my store was broken and not the stuff inside -which is worse.

Posted

I know public static is that it can be seen by other files, and private static is so that it cannot be seen by other files. It is static because it can be seen in other places.

Then what is the difference between
public

and

public static

?

 

As said before,

registerModEntity

takes in a

ResourceLocation

now. A

ResourceLocation

takes 2 parameters: a modid and an identifier. The modid is self-explanatory, and the identifier is either a path to a file or just a name. In this case a name, so just put the

name

variable as the second parameter.

 

This should be all you need to know about the Minecraft part of it, now you should go learn the Java part of it.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

[Then what is the difference between

public

and

public static

?

 

As said before,

registerModEntity

takes in a

ResourceLocation

now. A

ResourceLocation

takes 2 parameters: a modid and an identifier. The modid is self-explanatory, and the identifier is either a path to a file or just a name. In this case a name, so just put the

name

variable as the second parameter.

 

This should be all you need to know about the Minecraft part of it, now you should go learn the Java part of it.

 

referencing.

Posted

YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS I GOT IT IT TO WORK!!!!!

I FEEL SO AWESOME NOW!!!!

 

(I take back all that ugly stuff I said before.) (but seriously.... coremods are not supported here :P)

 

I can throw it! (haven't smoothed out the flight patterns or anything! but I can throw it! and it flies!)

YESSSSSSSSS, So elated!

 

Main class:

 

package exampled.modinfo;

import exampled.modinfo.entity.EntityOrb;
import exampled.modinfo.entity.EntitySphere;
import exampled.modinfo.init.ExampledEntities;
import exampled.modinfo.init.ExampledItems;
import exampled.modinfo.proxy.CommonProxy;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;

@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.MOD_VERSION)
public class Exampled
{
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
@Instance(Reference.MOD_ID)
private static Exampled instance;
public static ResourceLocation rsrcl;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	ModCreativeTabs.load();
	proxy.preInit();
	ExampledItems.init();
	ExampledItems.register();
	ExampledEntities.registerEntities(getResourceLocation());
	initRecipes();
}
    @EventHandler
    public void init(FMLInitializationEvent event)
    { 
    	
	proxy.registerRenders();
        proxy.registerKeybindings();
        NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    }	
private static void initRecipes()
{
	GameRegistry.addRecipe(new ItemStack(ExampledItems.SPHERE), new Object[] {" X ",  "X X", " X ", 'X', Item.getItemFromBlock(Blocks.DIRT)});
}
public static Exampled getInstance()
{
	return instance;
}
public static ResourceLocation getResourceLocation()
{
	return rsrcl;
}
}

 

 

ModEntitiesClass:

 

package exampled.modinfo.init;

import exampled.modinfo.Exampled;
import exampled.modinfo.Reference;
import exampled.modinfo.entity.EntityOrb;
import exampled.modinfo.entity.EntitySphere;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.EntityRegistry;

public class ExampledEntities
{	
static ResourceLocation rscrl = new ResourceLocation(Reference.MOD_ID, "EntitySphere");

public static void registerEntities(ResourceLocation rsrcl) {
	// TODO Auto-generated method stub
	EntityRegistry.registerModEntity(rscrl, EntitySphere.class, rscrl.toString(), 0, Exampled.getInstance(), 128, 214, true);
}
}

 

 

Friggin a dude, thank goodness. Couldn't have done it without your comment about public and public static, applause and thanks goes to you sir larsgerrits. <---this guys awesome.

BOOOOM, smooth flyin' thrown entity right there!!!!! no jitter as far as the eye can see!!!!

 

(saved ya 10 bucks)

 

WOOOOOOOOOOOOOOOOOO!

 

Edit: cleaned up modentityclass.

Posted
Since when do your entities work again?

 

 

Since now, and here's a 1.11 example thrown entity working src with a custom model and custom texture, since I don't feel like charging for it or keeping it to myself.

I'm not saying it couldn't be refined or anything. I just got it working. :);D:D:)

Renaming everything from example to make your own mod will show/teach you what to do. Its that simple.

 

https://www.dropbox.com/s/dlkuta8wakmr5rd/src.zip?dl=0

 

Programming is not magic, if there is an error in your program there is no way to magically just make it work because gurujive doesn't feel like debugging.

My code didn't have any errors though xD

----> in progress of magic mod now :P

 

This is bullshit. Nobody is "scoffing" or "insulting" you. But you have to live with the fact that if you don't know Java, we will tell you to go learn it elsewhere. If you walk into a car dealership they won't teach you how to drive.

I know, I'm just an innocent victim  ::)

 

Not sure where you are going with this, but yes, coremods are not supported here.

void utils is a coremod.

 

 

 

But aside from that, I'd like to say thanks for y'alls help and that I'm really thankful for all the quick responses.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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