Jump to content

[1.7.10] Issues with custom spawn egg


novemcinctus

Recommended Posts

I am attempting to create throwable spawn eggs.

My Item Class:

 

public class ItemThrowableEgg extends Item {
    protected EntityThrowableEgg entityEgg;
    private IIcon theIcon;
    public ItemThrowableEgg() {
        this.setTextureName("spawn_egg");
        this.setUnlocalizedName("thwoableEgg");
        this.setHasSubtypes(true);
        this.setCreativeTab(CreativeTabs.tabMisc);

    }
    @Override
    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)
        {
            entityEgg = new EntityThrowableEgg(par2World, par3EntityPlayer);
            entityEgg.setEntityToSpawn(par1ItemStack.getItemDamage());
            par2World.spawnEntityInWorld(entityEgg);
        }

        return par1ItemStack;
    }

    public String getItemStackDisplayName(ItemStack p_77653_1_)
    {
        String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
        String s1 = EntityList.getStringFromID(p_77653_1_.getItemDamage());

        if (s1 != null)
        {
            s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name");
        }

        return s;
    }

    @SideOnly(Side.CLIENT)
    public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_)
    {
        EntityList.EntityEggInfo entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(p_82790_1_.getItemDamage()));
        return entityegginfo != null ? (p_82790_2_ == 0 ? entityegginfo.primaryColor : entityegginfo.secondaryColor) : 16777215;
    }

    @SideOnly(Side.CLIENT)
    public boolean requiresMultipleRenderPasses()
    {
        return true;
    }

    /**
     * Gets an icon index based on an item's damage value and the given render pass
     */
    @SideOnly(Side.CLIENT)
    public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_)
    {
        return p_77618_2_ > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_);
    }

    /**
     * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
     */
    @SideOnly(Side.CLIENT)
    public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_)
    {
        Iterator iterator = EntityList.entityEggs.values().iterator();

        while (iterator.hasNext())
        {
            EntityList.EntityEggInfo entityegginfo = (EntityList.EntityEggInfo)iterator.next();
            p_150895_3_.add(new ItemStack(p_150895_1_, 1, entityegginfo.spawnedID));
        }
    }

    @SideOnly(Side.CLIENT)
    public void registerIcons(IIconRegister p_94581_1_)
    {
        super.registerIcons(p_94581_1_);
        this.theIcon = p_94581_1_.registerIcon(this.getIconString() + "_overlay");
    }
}

 

The item is registered like so:

GameRegistry.registerItem(new ItemThrowableEgg(), "thowableSpawnEggSpawn", MODID);

The item works fine until I try to create an EntityItem out of it:

 

ItemThrowableEgg throwableEgg = new ItemThrowableEgg();

ItemStack is = new ItemStack(throwableEgg,1, id);

e.drops.add(new EntityItem(e.entity.worldObj, e.entity.posX, e.entity.posY, e.entity.posZ, is));[/code]

 

When I get a huge stack trace and a NullPointerException as it tries to render in the inventory:

 

[14:55:24] [server thread/INFO]: Player210 has just earned the achievement [Taking Inventory]
[14:55:24] [Client thread/INFO]: [CHAT] Player210 has just earned the achievement [Taking Inventory]
[14:55:42] [Client thread/FATAL]: Reported exception thrown!
net.minecraft.util.ReportedException: Rendering item
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:624) ~[RenderItem.class:?]
at net.minecraft.client.gui.GuiIngame.renderInventorySlot(GuiIngame.java:973) ~[GuiIngame.class:?]
at net.minecraftforge.client.GuiIngameForge.renderHotbar(GuiIngameForge.java:209) ~[GuiIngameForge.class:?]
at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:144) ~[GuiIngameForge.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1114) ~[EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1056) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:951) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_65]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_65]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_65]
at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_65]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78) [start/:?]
at GradleStart.main(GradleStart.java:45) [start/:?]
Caused by: java.lang.NullPointerException
at net.minecraft.client.renderer.entity.RenderItem.renderIcon(RenderItem.java:760) ~[RenderItem.class:?]
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:515) ~[RenderItem.class:?]
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:585) ~[RenderItem.class:?]
... 15 more
[14:55:42] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----
// Don't do that.

Time: 11/16/14 2:55 PM
Description: Rendering item

java.lang.NullPointerException: Rendering item
at net.minecraft.client.renderer.entity.RenderItem.renderIcon(RenderItem.java:760)
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:515)
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:585)
at net.minecraft.client.gui.GuiIngame.renderInventorySlot(GuiIngame.java:973)
at net.minecraftforge.client.GuiIngameForge.renderHotbar(GuiIngameForge.java:209)
at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:144)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1114)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1056)
at net.minecraft.client.Minecraft.run(Minecraft.java:951)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78)
at GradleStart.main(GradleStart.java:45)


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

-- Head --
Stacktrace:
at net.minecraft.client.renderer.entity.RenderItem.renderIcon(RenderItem.java:760)
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:515)

-- Item being rendered --
Details:
Item Type: io.github.tesla.item.ItemThrowableEgg@529720c9
Item Aux: 93
Item NBT: null
Item Foil: false
Stacktrace:
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:585)
at net.minecraft.client.gui.GuiIngame.renderInventorySlot(GuiIngame.java:973)
at net.minecraftforge.client.GuiIngameForge.renderHotbar(GuiIngameForge.java:209)
at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:144)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player210'/3491, l='MpServer', x=1735.92, y=5.62, z=-197.75]]
Chunk stats: MultiplayerChunkCache: 620, 620
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options: 
Level spawn location: World: (1781,4,-275), Chunk: (at 5,0,13 in 111,-18; contains blocks 1776,0,-288 to 1791,255,-273), Region: (3,-1; contains chunks 96,-32 to 127,-1, blocks 1536,0,-512 to 2047,255,-1)
Level time: 81790 game time, 14259 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 142 total; [EntityItem['item.item.feather'/49558, l='MpServer', x=1736.22, y=4.12, z=-197.90], EntityItem['item.item.chickenRaw'/49559, l='MpServer', x=1736.08, y=4.12, z=-197.76], EntityWitherSkull['entity.WitherSkull.name'/1625, l='MpServer', x=1745.56, y=28.66, z=-170.47], EntityWitherSkull['entity.WitherSkull.name'/1624, l='MpServer', x=1745.09, y=6.53, z=-170.91], EntityWitherSkull['entity.WitherSkull.name'/1627, l='MpServer', x=1746.38, y=84.84, z=-170.81], EntityWitherSkull['entity.WitherSkull.name'/1626, l='MpServer', x=1744.47, y=70.25, z=-171.13], EntityWitherSkull['entity.WitherSkull.name'/1628, l='MpServer', x=1746.81, y=83.28, z=-170.81], EntityClientPlayerMP['Player210'/3491, l='MpServer', x=1735.92, y=5.62, z=-197.75], EntityPig['Pig'/1623, l='MpServer', x=1750.03, y=4.00, z=-166.97], EntityZombie['Zombie'/1622, l='MpServer', x=1752.22, y=4.00, z=-243.72], EntityCreeper['Creeper'/1221, l='MpServer', x=1699.50, y=4.00, z=-142.50], EntityItem['item.tile.dirt.default'/1220, l='MpServer', x=1696.66, y=3.13, z=-143.13], EntityItem['item.tile.dirt.default'/1217, l='MpServer', x=1699.88, y=3.13, z=-148.94], EntityItem['item.tile.dirt.default'/1216, l='MpServer', x=1699.81, y=3.13, z=-150.88], EntityCreeper['Creeper'/1219, l='MpServer', x=1697.50, y=4.00, z=-144.50], EntityItem['item.tile.dirt.default'/1218, l='MpServer', x=1698.53, y=3.13, z=-148.13], EntitySlime['Slime'/1787, l='MpServer', x=1772.25, y=3.00, z=-245.22], EntityHorse['Horse'/1790, l='MpServer', x=1781.81, y=4.00, z=-178.38], EntityZombie['Zombie'/1791, l='MpServer', x=1786.50, y=4.00, z=-182.50], EntitySlime['Slime'/1788, l='MpServer', x=1775.37, y=4.47, z=-214.07], EntitySlime['Slime'/1789, l='MpServer', x=1796.50, y=3.00, z=-196.09], EntitySlime['Slime'/1270, l='MpServer', x=1711.28, y=4.00, z=-225.50], EntityPig['Pig'/1271, l='MpServer', x=1715.78, y=4.00, z=-216.78], EntityCreeper['Creeper'/660, l='MpServer', x=1662.00, y=4.00, z=-241.50], EntityWitherSkull['entity.WitherSkull.name'/1278, l='MpServer', x=1716.44, y=61.72, z=-170.81], EntitySkeleton['Skeleton'/1279, l='MpServer', x=1714.56, y=4.00, z=-154.06], EntityWitherSkull['entity.WitherSkull.name'/1276, l='MpServer', x=1718.94, y=47.16, z=-171.13], EntityWitherSkull['entity.WitherSkull.name'/1277, l='MpServer', x=1720.91, y=43.63, z=-170.94], EntityPig['Pig'/1274, l='MpServer', x=1722.06, y=4.00, z=-160.97], EntityWitherSkull['entity.WitherSkull.name'/1275, l='MpServer', x=1712.28, y=38.16, z=-170.56], EntitySkeleton['Skeleton'/1272, l='MpServer', x=1721.09, y=4.00, z=-179.94], EntitySlime['Slime'/1273, l='MpServer', x=1715.59, y=4.83, z=-179.07], EntityCow['Cow'/746, l='MpServer', x=1665.16, y=4.00, z=-161.03], EntityWitherSkull['entity.WitherSkull.name'/745, l='MpServer', x=1676.72, y=16.69, z=-190.09], EntityItem['item.tile.dirt.default'/744, l='MpServer', x=1679.13, y=2.13, z=-186.03], EntityItem['item.tile.dirt.default'/739, l='MpServer', x=1678.56, y=3.13, z=-185.13], EntityItem['item.tile.dirt.default'/738, l='MpServer', x=1677.28, y=3.13, z=-188.19], EntityItem['item.tile.dirt.default'/737, l='MpServer', x=1679.88, y=3.13, z=-189.63], EntityItem['item.tile.dirt.default'/736, l='MpServer', x=1679.84, y=3.13, z=-188.41], EntityItem['item.tile.dirt.default'/743, l='MpServer', x=1679.19, y=2.13, z=-187.16], EntityItem['item.tile.dirt.default'/742, l='MpServer', x=1677.13, y=3.13, z=-186.78], EntityItem['item.tile.dirt.default'/741, l='MpServer', x=1678.63, y=3.13, z=-187.63], EntityItem['item.tile.dirt.default'/740, l='MpServer', x=1677.88, y=3.13, z=-186.31], EntityCow['Cow'/1718, l='MpServer', x=1777.13, y=4.00, z=-120.78], EntityItem['item.tile.dirt.default'/762, l='MpServer', x=1678.44, y=3.13, z=-148.56], EntityItem['item.tile.dirt.default'/760, l='MpServer', x=1679.47, y=3.13, z=-148.88], EntityWitherSkull['entity.WitherSkull.name'/1716, l='MpServer', x=1772.25, y=27.31, z=-170.47], EntityItem['item.tile.dirt.default'/761, l='MpServer', x=1677.47, y=3.13, z=-149.88], EntityChicken['Chicken'/1717, l='MpServer', x=1774.59, y=4.00, z=-152.56], EntitySpider['Spider'/1714, l='MpServer', x=1779.94, y=4.00, z=-166.81], EntitySpider['Spider'/1715, l='MpServer', x=1773.72, y=4.00, z=-168.25], EntityHorse['Horse'/1713, l='MpServer', x=1764.03, y=4.00, z=-179.28], EntityWitherSkull['entity.WitherSkull.name'/754, l='MpServer', x=1677.88, y=16.56, z=-170.59], EntityWitherSkull['entity.WitherSkull.name'/755, l='MpServer', x=1677.09, y=32.16, z=-170.78], EntityItem['item.tile.dirt.default'/758, l='MpServer', x=1677.13, y=3.13, z=-148.47], EntityItem['item.tile.dirt.default'/759, l='MpServer', x=1677.47, y=3.13, z=-147.19], EntityWitherSkull['entity.WitherSkull.name'/756, l='MpServer', x=1673.88, y=73.59, z=-171.69], EntityWitherSkull['entity.WitherSkull.name'/757, l='MpServer', x=1678.44, y=79.22, z=-171.16], EntityWitherSkull['entity.WitherSkull.name'/728, l='MpServer', x=1676.63, y=38.09, z=-229.81], EntityPig['Pig'/1202, l='MpServer', x=1711.16, y=4.00, z=-192.38], EntityWitherSkull['entity.WitherSkull.name'/729, l='MpServer', x=1675.00, y=12.34, z=-219.50], EntityPig['Pig'/1203, l='MpServer', x=1703.16, y=4.00, z=-184.16], EntityWitherSkull['entity.WitherSkull.name'/730, l='MpServer', x=1676.78, y=41.25, z=-219.25], EntityWitherSkull['entity.WitherSkull.name'/731, l='MpServer', x=1676.31, y=33.84, z=-196.03], EntityWitherSkull['entity.WitherSkull.name'/732, l='MpServer', x=1679.38, y=50.78, z=-200.81], EntityItem['item.tile.dirt.default'/1206, l='MpServer', x=1705.88, y=3.13, z=-169.97], EntityWitherSkull['entity.WitherSkull.name'/733, l='MpServer', x=1672.13, y=74.78, z=-195.81], EntityWitch['Witch'/2147, l='MpServer', x=1814.44, y=4.00, z=-218.91], EntityItem['item.tile.dirt.default'/1207, l='MpServer', x=1704.84, y=3.13, z=-171.63], EntityPig['Pig'/1204, l='MpServer', x=1708.47, y=4.00, z=-179.88], EntityItem['item.tile.dirt.default'/735, l='MpServer', x=1679.09, y=3.13, z=-189.03], EntityPig['Pig'/1205, l='MpServer', x=1692.91, y=4.00, z=-186.03], EntityWitherSkull['entity.WitherSkull.name'/1210, l='MpServer', x=1706.88, y=35.38, z=-170.78], EntityBitchThias['Bitch-Thias'/721, l='MpServer', x=1656.30, y=4.00, z=-244.22], EntityWitherSkull['entity.WitherSkull.name'/1211, l='MpServer', x=1697.63, y=130.66, z=-170.97], EntityItem['item.tile.dirt.default'/1208, l='MpServer', x=1704.44, y=3.13, z=-169.59], EntityBitchThias['Bitch-Thias'/722, l='MpServer', x=1665.26, y=4.00, z=-255.08], EntitySlime['Slime'/723, l='MpServer', x=1671.10, y=4.62, z=-259.48], EntityWitherSkull['entity.WitherSkull.name'/1209, l='MpServer', x=1707.47, y=25.44, z=-171.03], EntityItem['item.tile.dirt.default'/1214, l='MpServer', x=1698.63, y=3.13, z=-150.88], EntityItem['item.tile.dirt.default'/1215, l='MpServer', x=1698.56, y=3.13, z=-149.38], EntityPig['Pig'/1212, l='MpServer', x=1697.50, y=4.00, z=-146.17], EntityCreeper['Creeper'/726, l='MpServer', x=1672.74, y=4.00, z=-258.27], EntityItem['item.tile.dirt.default'/1213, l='MpServer', x=1697.56, y=3.13, z=-148.66], EntityWitherSkull['entity.WitherSkull.name'/727, l='MpServer', x=1676.28, y=15.69, z=-238.06], EntityXPOrb['Experience Orb'/1405, l='MpServer', x=1737.75, y=4.25, z=-271.59], EntityXPOrb['Experience Orb'/1404, l='MpServer', x=1732.78, y=4.25, z=-266.66], EntitySlime['Slime'/1401, l='MpServer', x=1740.81, y=4.00, z=-268.69], EntityWitherSkull['entity.WitherSkull.name'/776, l='MpServer', x=1678.69, y=87.28, z=-155.16], EntityWitherSkull['entity.WitherSkull.name'/777, l='MpServer', x=1673.56, y=119.19, z=-155.22], EntityPig['Pig'/1282, l='MpServer', x=1716.37, y=4.00, z=-121.28], EntityWitherSkull['entity.WitherSkull.name'/1283, l='MpServer', x=1723.56, y=60.00, z=-138.56], EntitySkeleton['Skeleton'/1280, l='MpServer', x=1713.50, y=4.00, z=-151.50], EntityZombie['Zombie'/1281, l='MpServer', x=1710.84, y=4.00, z=-156.13], EntityWitherSkull['entity.WitherSkull.name'/1284, l='MpServer', x=1725.91, y=78.84, z=-138.94], EntityItem['item.item.chickenRaw'/29890, l='MpServer', x=1738.69, y=4.13, z=-207.43], EntityItem['item.item.null'/29891, l='MpServer', x=1738.99, y=4.13, z=-209.72], EntityItem['item.item.feather'/29892, l='MpServer', x=1739.88, y=4.13, z=-208.95], EntityLargeFireball['Fireball'/1798, l='MpServer', x=1791.03, y=102.69, z=-160.63], EntityWitherSkull['entity.WitherSkull.name'/1796, l='MpServer', x=1784.81, y=47.78, z=-171.47], EntityWitherSkull['entity.WitherSkull.name'/1797, l='MpServer', x=1788.44, y=56.88, z=-172.66], EntityCreeper['Creeper'/1794, l='MpServer', x=1781.50, y=4.00, z=-165.50], EntitySkeleton['Skeleton'/1795, l='MpServer', x=1782.50, y=4.00, z=-168.50], EntityZombie['Zombie'/1792, l='MpServer', x=1788.50, y=4.00, z=-183.50], EntityHorse['Horse'/1793, l='MpServer', x=1781.23, y=4.00, z=-173.11], EntitySkeleton['Skeleton'/1001, l='MpServer', x=1692.50, y=4.00, z=-138.50], EntityWitherSkull['entity.WitherSkull.name'/1411, l='MpServer', x=1731.06, y=67.09, z=-170.75], EntityPig['Pig'/1000, l='MpServer', x=1689.09, y=4.00, z=-137.16], EntityWitherSkull['entity.WitherSkull.name'/1410, l='MpServer', x=1736.59, y=36.25, z=-170.56], EntityChicken['Chicken'/1408, l='MpServer', x=1736.01, y=4.52, z=-197.10], EntityItem['item.tile.dirt.default'/993, l='MpServer', x=1694.13, y=3.13, z=-143.88], EntityItem['item.tile.dirt.default'/995, l='MpServer', x=1693.78, y=3.13, z=-142.88], EntityItem['item.tile.dirt.default'/994, l='MpServer', x=1695.00, y=3.13, z=-143.13], EntityItem['item.tile.dirt.default'/997, l='MpServer', x=1688.22, y=3.13, z=-134.38], EntityItem['item.tile.dirt.default'/996, l='MpServer', x=1695.25, y=3.13, z=-142.06], EntityWitherSkull['entity.WitherSkull.name'/986, l='MpServer', x=1680.16, y=8.28, z=-171.44], EntityCreeper['Creeper'/1942, l='MpServer', x=1803.57, y=4.00, z=-195.28], EntityWitherSkull['entity.WitherSkull.name'/987, l='MpServer', x=1683.81, y=17.88, z=-171.22], EntityWitherSkull['entity.WitherSkull.name'/1943, l='MpServer', x=1793.16, y=41.97, z=-188.41], EntityChicken['Chicken'/1940, l='MpServer', x=1793.38, y=4.00, z=-217.56], EntityCreeper['Creeper'/984, l='MpServer', x=1687.50, y=4.00, z=-252.50], EntityChicken['Chicken'/1941, l='MpServer', x=1793.53, y=4.00, z=-202.69], EntityZombie['Zombie'/985, l='MpServer', x=1690.50, y=4.00, z=-230.50], EntityItem['item.item.porkchopRaw'/990, l='MpServer', x=1683.19, y=4.13, z=-150.81], EntityZombie['Zombie'/1938, l='MpServer', x=1805.50, y=4.00, z=-270.50], EntitySpider['Spider'/991, l='MpServer', x=1685.22, y=4.00, z=-153.00], EntityZombie['Zombie'/1939, l='MpServer', x=1807.50, y=4.00, z=-224.50], EntityWitherSkull['entity.WitherSkull.name'/988, l='MpServer', x=1690.66, y=43.47, z=-171.19], EntityWitherSkull['entity.WitherSkull.name'/989, l='MpServer', x=1680.97, y=240.00, z=-171.84], EntityCow['Cow'/1950, l='MpServer', x=1806.09, y=4.00, z=-148.03], EntitySlime['Slime'/978, l='MpServer', x=1677.60, y=4.00, z=-274.06], EntityCow['Cow'/1951, l='MpServer', x=1800.19, y=4.00, z=-137.84], EntitySlime['Slime'/979, l='MpServer', x=1682.43, y=4.46, z=-265.68], EntityWitherSkull['entity.WitherSkull.name'/1948, l='MpServer', x=1797.34, y=80.41, z=-170.69], EntityWitherSkull['entity.WitherSkull.name'/1949, l='MpServer', x=1798.31, y=232.09, z=-171.91], EntityCreeper['Creeper'/982, l='MpServer', x=1693.50, y=4.00, z=-243.50], EntityWitherSkull['entity.WitherSkull.name'/1947, l='MpServer', x=1794.81, y=86.91, z=-170.59], EntityCreeper['Creeper'/983, l='MpServer', x=1699.69, y=3.00, z=-242.50], EntityHorse['Horse'/1944, l='MpServer', x=1795.56, y=4.00, z=-174.28], EntityZombie['Zombie'/980, l='MpServer', x=1690.50, y=4.00, z=-250.50], EntityWitherSkull['entity.WitherSkull.name'/1945, l='MpServer', x=1796.16, y=32.09, z=-170.81], EntityCreeper['Creeper'/981, l='MpServer', x=1700.21, y=4.00, z=-249.95]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2555)
at net.minecraft.client.Minecraft.run(Minecraft.java:973)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78)
at GradleStart.main(GradleStart.java:45)

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Mac OS X (x86_64) version 10.10
Java Version: 1.6.0_65, Apple Inc.
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.
Memory: 871625312 bytes (831 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.05 FML v7.10.85.1235 Minecraft Forge 10.13.2.1235 4 mods loaded, 4 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{7.10.85.1235} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1235.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{10.13.2.1235} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1235.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
betterdrops{1.3.1} [betterdrops] (main) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Launched Version: 1.7.10
LWJGL: 2.9.1
OpenGL: Intel HD Graphics 4000 OpenGL Engine GL version 2.1 INTEL-10.0.86, Intel Inc.
GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because ARB_framebuffer_object is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)
[14:55:42] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# /Users/tesla/IdeaProjects/MCForge17/eclipse/./crash-reports/crash-2014-11-16_14.55.42-client.txt
[14:55:42] [Client Shutdown Thread/INFO]: Stopping server

 

The entityitem I see on the ground before picking it up has a missing texture. When I get a throwableEgg from my creative inventory and drop it, the texture looks fine.

 

Why is this?

Link to comment
Share on other sites

You should only be making a new ItemThrowableEgg ONCE, and then referencing that instance everywhere else (assuming you only have one ItemThrowableEgg - if you have more, make multiple instances).

 

That's why in every item-making tutorial, you always see stuff like this:

public static Item throwableEgg;

// preInit
throwableEgg = new ItemThrowableEgg();
GameRegistry.registerItem(throwableEgg, 'throwableEgg', modid);

ItemStack egg = new ItemStack(YourMod.throwableEgg);

throwableEgg is the reference that you can use everywhere, because the item only exists as a single object - if you made a new Item for every single item in the game, that would waste a lot of memory.

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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