Jump to content

Getting a Entity to "switch" type


hotrods20

Recommended Posts

I am really working in waters a lot of modders tend to ignore or avoid.  Might as well get to the point, I am trying to get my mob to convert into a different mob.  Yes it is a zombie like creature.

zombie = (new EntityNuclearZombie(ModLoader.getMinecraftInstance().theWorld));
zombie.setLocationAndAngles(this.posX, this.posY, this.posZ, ModLoader.getMinecraftInstance().theWorld.rand.nextFloat() * 360.0F, 0.0F);
ModLoader.getMinecraftInstance().theWorld.spawnEntityInWorld(zombie);

This is the code that spawns the new entity and is surrounded by a if statement that check if the entity is dead.  The if statement is in the onUpdate method.  I have a boolean variable that determines if the creature converted.  That makes sure the mob doesn't spawn a huge group of other mobs.  What can/would I need to add to have it so it check the mob that attacked it?  I know of the getLastAttackEntity method but I can't seem to get it to work.  It either spawns a "zombie" all the time or never.

width=320 height=64http://www.slothygaming.com/img/ota.png[/img]

If your grammar is shit and you blatantly don't know what you're doing, I will not help you.

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.