Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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 :)

If you are developing for 1.7.2+, I believe you should use @SubscribeEvent instead of @ForgeSubscribe.

  • 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.
    	}
    }

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/

  • 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.

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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.