Posted July 5, 201411 yr Hello, I am in need of assistance in making vanilla mobs, (pig,cow,chicken,etc..), hostile when attacked.
July 5, 201411 yr 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
July 5, 201411 yr If you are developing for 1.7.2+, I believe you should use @SubscribeEvent instead of @ForgeSubscribe.
July 5, 201411 yr Author This is what I have so far, not entirely sure where I go from here. @SubscribeEvent public void hostileMobEvent(AttackEntityEvent event) { if (event.entity instanceof EntityAnimal) { entity. } }
July 6, 201411 yr 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/
July 6, 201411 yr Author I am trying to make my custom entity look like a cow. In 1.7.2 forge, what is the method that I need to call?
July 6, 201411 yr Author 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) { super(par1World); } } How would I go about loading the model.
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.