Recently I was needing to know what causes animals to flee, and after some searching (And trial and error) I think I found it in the fleeingTick variable. Is this right? Also, I was trying to figure out if there was a way to modify this so that animals will flee/be frantic if a certain mob is nearby?
The only way I've found to make this work so far is to modify the findPlayerToAttack code so that if a mob is within a certain distance then the animal's attackEntityFrom is run with a damage source of generic and integer of 0. It is really annoying though to see them running around flashing red.
Ah sorry, rereading this I realize I wasn't very clear about what I was attempting to do.
I have a mob. Lets say this mob, like wolves, attacks sheep. What I want to do is, without modifying the EntitySheep.class code, cause the sheep to starting panicking/fleeing if my mob is nearby. I'd like to have the code that starts this off be within my mobs EntityMyMob.class file. I just can't seem to figure out how to do this.
[Off-Topic]
On a random note, I've just discovered how much fun it is to make an animal be in noClip mode if another one is nearby. It is quite hilarious to watch xD
Edit: One of my animals in no clip is now flying towards the clouds.... lol xD
[/Off-Topic]
The only way I've found to make this work so far is to modify the findPlayerToAttack code so that if a mob is within a certain distance then the animal's attackEntityFrom is run with a damage source of generic and integer of 0. It is really annoying though to see them running around flashing red.
Anyone have any help, tips, anything about this?
I have a mob. Lets say this mob, like wolves, attacks sheep. What I want to do is, without modifying the EntitySheep.class code, cause the sheep to starting panicking/fleeing if my mob is nearby. I'd like to have the code that starts this off be within my mobs EntityMyMob.class file. I just can't seem to figure out how to do this.
[Off-Topic]
On a random note, I've just discovered how much fun it is to make an animal be in noClip mode if another one is nearby. It is quite hilarious to watch xD
Edit: One of my animals in no clip is now flying towards the clouds.... lol xD
[/Off-Topic]
That works great, thanks :biggrin.gif: Doesn't make them flee, but with some slight modifications I figured out who to make them run away/flee/panic