Started by
FlyingCatOfLol
on
Topic category: Help with Minecraft modding (Java Edition)
I have a Villager which will attack illagers, but how do i make illagers attack it, illagers as in vanilla mobs like pillagers and vindicators.
Topic category: Help with Minecraft modding (Java Edition)
I have a Villager which will attack illagers, but how do i make illagers attack it, illagers as in vanilla mobs like pillagers and vindicators.
I would also like an answer to this
months later but try this
https://imgur.com/jzAffOd
used this code
((MobEntity)entity).targetSelector.addGoal(1, new NearestAttackableTargetGoal((MobEntity)entity, JakethedogEntity.CustomEntity.class, false, false));
replace the "JakethedogEntity" with your entity public class name. for some reason this doesn't work for indicators when I was testing it, I'm not sure why
use this link instead since the other one messed up
"https://imgur.com/jzAffOd"
but where do i put it
i followed minotheboy's tutorial but it gives me some errors
ill only put the important parts here
but it seems like it doesnt know what MobEntity and CustomEntity mean
Can you explain each part like entity public class name, because my dumb brain doesn't know how to use it
Say i have an entity in my mod called "Mouse", and i want it to be attacked by vanilla Cats, then would i replace "JakethedogEntity" with "MouseEntity", and ((MobEntity)entity) with ((CatEntity)entity)?
would that change the code to ((CatEntity)entity).targetSelector.addGoal(1, new NearestAttackableTargetGoal((CatEntity)entity, MouseEntity.CustomEntity.class, false, false));