zombies.push(e)
}
}
then write a function that identifies when the zombies are close to the spiders
and then write the loop for it to make it work on all of them
Then u know just do Entity.setTarget on both of this two
did not even try this yet but i thnk it will work i hope lol
How could i make a mob target an entity by default like zombies and villagers?
use the Entity.setTarget function
or just make an array of the attacker and the victims
just like this
var zombies = []
var spiders = []
function entityAddedHook(e){
if(Entity.getEntityTypeId(e)==35){
spiders.push(e)
}
if(Entity.getEntityTypeId(e)==32){
zombies.push(e)
}
}
then write a function that identifies when the zombies are close to the spiders
and then write the loop for it to make it work on all of them
Then u know just do Entity.setTarget on both of this two
did not even try this yet but i thnk it will work i hope lol
victim = [];
attacker = [];
function entityAddedHook(e){
if(Entity.getEntityTypeId(e)==EntityType.VILLAGER){
victim.push(e);
}
if(Entity.getEntityTypeId(e)==EntityType.WOLF){
attacker.push(e);
}}
function modTick(){
for(i=0;i<victim.length;i++){
for(ii=0;ii<attacker.length;ii++){
Entity.setTarget(attacker[ii],victim);
}}}
is what i used but i get an error at the end saying i need to have an object as target.
It works though