Started by
lightmiester
on
Topic category: Troubleshooting, bugs, and solutions
I made an item that summons iron golems in my mod. Whenever I use it, it summons two iron golems. One that I cannot harm and I cannot move, and it does not move on its own either. But the second one acts as a normal iron golem should. Any ideas on how to fix this?
Just relog and then the fake golem should disappear.
Thanks for the help but is there anyway for this stop happening entirely?
@#2 Yes, put this in your Item code:
Entity sentity = EntityList.createEntityByName("YOURMOBSNAME", world);
if (sentity != null){sentity.setLocationAndAngles(i, j, k, world.rand.nextFloat() * 360F, 0.0F);
if (!world.isRemote) {
world.spawnEntityInWorld(sentity);
}
((EntityLiving)sentity).playLivingSound();}
}
}
for YOURMOBSNAME put the name of your golem in undercase. Ex: if your golem mob is named Jimmy put jimmy. However if it JimmySoup put jimmySoup
This code works for 1.7.10. I dont know what version you have.