Jump to content

[1.7.2] Making Vanilla mobs hostile on attack.


Recommended Posts

Then I would suggest you @ForgeSubscribe and use onEntityAttackEvent and extends it about your own way. Good example of how this works is almost similar ThaumicTinkerer onLivingDropEvent or somewhat like that. I did not remember right and exact names, but... This should be pretty helpful :)

Link to comment
Share on other sites

You can change the AI of vanilla mobs directly.  However, passive animals don't have a targetTasks list, so I don't think it would be easy to add hostile AI tasks. 


So I think what you want to do is create your own custom EntityHostileCow, EntityHostileSheep, etc. that extend the original passive animal.  But you would add target AI tasks similar to what hostile mobs have.


Then you would handle the LivingSpawnEvent, and if the event.entityLiving instanceof EntityCow you'd replace it with your EnityHostileCow, and so forth.


If your custom classes extend the vanilla ones, then they should generally be treated as the original, except the AI would be different.  Note that to successfully attack a mob also needs to register an attackDamage attribute.



Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

This is what I have so far, I am looking at making a cow act like a zombie. For this, I am creating a custom entity like you said, and then altering it to appear and sound like a cow.


public class TSTweaksCow extends EntityZombie {

public TSTweaksCow(World par1World) {


How would I go about loading the model.

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.

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.