ThatRandomGuy296's Avatar
Level 12
Journeyman Engineer
2

Forum Posts

1 - 19 of 19

    ThatRandomGuy296
    09/22/2013 1:43 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    That's what I figured, but when I lowered it, I still got an error. So then I changed the ID and version of the mod to return "v.1.0.0" and my mod worked, thanks for the help
    1
    ThatRandomGuy296
    09/22/2013 12:02 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    Alright, I feel like it's the ID that's stopping it, but I've changed it multiple times to no avail, can I get a hint on what to fix?
    1
    ThatRandomGuy296
    06/28/2013 4:45 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    It splits into two and goes back to one when it goes really far but it works I doubt many people will throw to far. Thank You very much!
    1
    ThatRandomGuy296
    06/28/2013 12:15 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    Nvm it works!!!! I just can't see the item till it's farther away from me ty so much
    1
    ThatRandomGuy296
    06/28/2013 11:51 am
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    changed it but it still doesn't throw for some reason
    1
    ThatRandomGuy296
    06/27/2013 7:12 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    Checked out the thread, my code looks almost exactly the same but it still doesn't work. Mind taking a fast look?

    Mod File
    Click to reveal

    package net.minecraft.src;
    import java.util.Map;

    public class mod_duckPresents extends BaseMod
    { public static final Item GoldenEggs = new ItemGoldenEggs(3000).setCreativeTab(CreativeTabs.tabMaterials).setUnlocalizedName("goldenegg");

    public void load() {
    ModLoader.addName(GoldenEggs, "Gold Egg");
    ModLoader.registerEntityID(EntityGoldenEggs.class, "Grenade", -2000);
    ModLoader.addEntityTracker(this, EntityGoldenEggs.class, -2000, 20, 5, true);
    }



    public Entity spawnEntity(int var1, World var2, double var3, double var5, double var7) { switch (var1) { case 3000: return new EntityGoldenEggs(var2); default: return null; } } public Packet23VehicleSpawn getSpawnPacket(Entity var1, int var2) { return var1 instanceof EntityGoldenEggs ? new Packet23VehicleSpawn(var1, var2) : null; } public void addRenderer(Map var1) { var1.put(EntityGoldenEggs.class, new RenderSnowball(GoldenEggs)); }

    public String getVersion() {
    return null;
    }


    }


    Item File
    Click to reveal

    package net.minecraft.src;
    import java.util.Random;
    public class ItemGoldenEggs extends Item
    {
    public void registerIcons(IconRegister par1IconRegister)
    {
    this.itemIcon = par1IconRegister.registerIcon("goldenegg");
    }

    public ItemGoldenEggs(int par1)
    {
    super(par1);
    this.maxStackSize = 16;


    }




    public void RegisterIcons(IconRegister par1IconRegister)
    {
    this.itemIcon = par1IconRegister.registerIcon("goldenegg");
    }


    /**
    * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
    */
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
    if (!par3EntityPlayer.capabilities.isCreativeMode)
    {
    --par1ItemStack.stackSize;
    }

    par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));

    if (!par2World.isRemote)
    {
    par2World.spawnEntityInWorld(new EntityGoldenEggs(par2World, par3EntityPlayer));
    }

    return par1ItemStack;
    }
    }


    Entity File
    Click to reveal

    package net.minecraft.src;

    public class EntityGoldenEggs extends EntityThrowable
    {
    public EntityGoldenEggs(World par1World)
    {
    super(par1World);
    }

    public EntityGoldenEggs(World par1World, EntityLiving par2EntityLiving)
    {
    super(par1World, par2EntityLiving);
    }

    public EntityGoldenEggs(World par1World, double par2, double par4, double par6)
    {
    super(par1World, par2, par4, par6);
    }

    /**
    * Called when this EntityThrowable hits a block or entity.
    */
    protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
    {
    if (par1MovingObjectPosition.entityHit != null)
    {
    byte var2 = 0;

    if (par1MovingObjectPosition.entityHit instanceof EntityBlaze)
    {
    var2 = 3;
    }

    par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), var2);
    }

    for (int var3 = 0; var3 < 8; ++var3)
    {
    //You can set particles here, such as "flame" or "smoke", or add explosion code
    this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
    }

    if (!this.worldObj.isRemote)
    {
    this.setDead();
    }
    }
    }
    1
    ThatRandomGuy296
    06/26/2013 10:23 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    Thank you for that link! I'll look at that in full detail tomorrow
    1
    ThatRandomGuy296
    06/26/2013 7:55 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    I have experimented with the snowball code, but I got nowhere. I usually come to the forums last.
    1
    ThatRandomGuy296
    06/17/2013 9:06 am
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    I'm using ModLoader
    1
    ThatRandomGuy296
    06/16/2013 4:14 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    Alright back to experimenting >;D thank you for all your help
    1
    ThatRandomGuy296
    06/16/2013 3:16 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    Got it to work also, do you have any idea why it won't spawn the armor in the entity file?
    1
    ThatRandomGuy296
    06/16/2013 1:28 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    Can't find any other ways... any advice where to put textures?
    1
    ThatRandomGuy296
    06/15/2013 10:41 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    yup... i'll look up some other ways online if it's possible
    1
    ThatRandomGuy296
    06/15/2013 9:04 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    I got the item to show up but I need help with the texture.. I have it in 3 spots but none are right cause I got this error when ran ..

    2013-06-15 20:43:36 [CLIENT] [WARNING] TextureManager.createTexture called for file textures/items/null.png, but that file does not exist. Ignoring.

    Is there any correct spot to put my texture?
    1
    ThatRandomGuy296
    06/14/2013 8:33 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    I changed the code in the mod file but for the Item class code I get the error:

    iconIndex cannot be resolved or is not a field

    for iconIndex

    Edit: did a quick search and iconIndex was changed to itemIcon now lets see if it works... nope not working
    1
    ThatRandomGuy296
    06/14/2013 6:38 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    I already had that piece of code there when I installed my mod but it still didn't work. Any other ideas?
    1
    ThatRandomGuy296
    06/14/2013 8:02 am
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    I have that at the top of my item file... Is that what you mean by item class?
    1
    ThatRandomGuy296
    06/08/2013 4:21 pm
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    Cool will do
    1
    ThatRandomGuy296
    06/08/2013 7:17 am
    Level 12 : Journeyman Engineer
    ThatRandomGuy296's Avatar
    Omg you helped A LOT! You explained it perfectly. I already had MCP and eclipse just needed to really know how to approach the egg coding because the tutorials I was following only had make new items not edit old ones. Thank you so much!

    One small question: you put moc_file did ou mean mod_file?
    1

1 - 19 of 19

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome