Help me with summoning an Enderman please!

Started by Mr_Alpha on Tue, 04/12/2016 - 22:51

Topic category: Help with MCreator modding

Last seen on 20:03, 30. Apr 2019
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Help me with summoning an Enderman please!
Tue, 04/12/2016 - 22:51

I set an item to summon entity with ID 58 (Enderman) one block above the block you right click on. It spawns, but gravity doesn't affect it, it doesn't move and won't attack you. It stays in an infinite loop of its standing animation and you can't hit it. I tried execute command on rightclick on block and put "summon Enderman ~ ~1 ~" (because it says command without the /) and it says you do not have permissions. I turned on cheats via hosting the world on LAN and it still didn't work. Then, I typed /summon Enderman in the chat and an Enderman appeared and worked completely. If you help me in a reply and it works, you'll get a dedication on the mod page! Thanks!

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
It is the "ghost mob" bug.
Wed, 04/13/2016 - 05:37

It is the "ghost mob" bug. The real enderman spawned but probably instantly tped away. The ghost enderman would disappear after relogging.

To fix this bug, add if(!world.isRemote){ before the spawning code and close with the bracket }

so it should look like: 

Entity sentity = EntityList.createEntityByName("name", world);if (sentity != null){sentity.setLocationAndAngles(i, j, k, world.rand.nextFloat() * 360F, 0.0F);if(!world.isRemote){world.spawnEntityInWorld(sentity);}((EntityLiving)sentity).playLivingSound();}
}

Last seen on 20:03, 30. Apr 2019
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:It is the "ghost mob" bug.
Wed, 04/13/2016 - 13:08

@#1 Thanks! Do you know what line of code that will be on? Or at least a general area?

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:RE:It is the "ghost mob" bug.
Wed, 04/13/2016 - 17:13

@#1.1 see my example

Entity sentity = EntityList.createEntityByName("name", world);if (sentity != null){sentity.setLocationAndAngles(i, j, k, world.rand.nextFloat() * 360F, 0.0F);if(!world.isRemote){world.spawnEntityInWorld(sentity);}((EntityLiving)sentity).playLivingSound();}
}

Last seen on 20:03, 30. Apr 2019
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:RE:RE:It is the "ghost mob" bug.
Wed, 04/13/2016 - 19:53

@#1.1.1 Ok, I found the spot. Thanks a lot. :) Let's hope this works...

 

UPDATE: OK, I got the semicolon placing wrong. Rewriting and retrying...

 

UPDATE 2: It still doesn't work. The enderman spawns in like before and jsut stands there. This time I shot it with a bow and it disappeared, but there was no enderman in sight within 100 blocks radius. The code did literally nothing, sorry. Any other suggestions?

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
RE:RE:RE:RE:It is the "ghost mob" bug.
Wed, 04/13/2016 - 20:00

@#1.1.1.1 Can you show the code?

Last seen on 20:03, 30. Apr 2019
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:RE:RE:RE:RE:It is the "ghost mob" bug.
Wed, 04/13/2016 - 20:04

@#1.1.1.1.1 I think I'm just going to have it give you an enderman spawn egg. But... You can only spawn a generic spawn egg. Do you know how to select a spawn egg of a specific mob?

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
 Maybe: new ItemStack(Item
Wed, 04/13/2016 - 20:13

 Maybe: new ItemStack(Item.getItemById(383),1,58);

Last seen on 20:03, 30. Apr 2019
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE: Maybe: new ItemStack(Item
Wed, 04/13/2016 - 20:31

@#2 Thanks, I'll try it.

Last seen on 20:03, 30. Apr 2019
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE: Maybe: new ItemStack(Item
Thu, 04/14/2016 - 17:20

@#2 Okay, so it worked and it didn't work. It gave me the egg, but then I tried to use it and all of the multiple eggs in my inventory disappeared and it didn't spawn an enderman on rightclick. Do you have any ideas on how to just summon it in without the "Ghost Mob Bug?"