Summons two golems instead of one

Started by lightmiester on

Topic category: Troubleshooting, bugs, and solutions

Joined May 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Summons two golems instead of one

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?

 
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just relog and then the fake
Fri, 08/04/2017 - 11:11

Just relog and then the fake golem should disappear.

Joined May 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for the help but is
Fri, 08/04/2017 - 21:44

Thanks for the help but is there anyway for this stop happening entirely?

 

Joined Jul 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:Thanks for the help but is
Fri, 08/04/2017 - 22:59

@#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.