#Make mob ignore Player conditionally

13 messages · Page 1 of 1 (latest)

granite ferry
#

Hey so I managed to ignore hurt events on both the Player and the Entity

let disallowPreAftermathPlayerHurtAftermathMob=true
if(disallowPreAftermathPlayerHurtAftermathMob){
    EntityEvents.hurt(event => {
        const { entity, source } = event;
        if (!aftermathExlusiveMobs.includes(entity.type)) return

        if (source.player != null) {
            if(!source.player.stages.has('witherKilled')){
                event.cancel();
            }
        }
    })
}
let disallowPostAftermathMobsHurtPlayer=true
if(disallowPostAftermathMobsHurtPlayer){
    EntityEvents.hurt(event => {
        const { entity, source } = event;
        if (!entity.isPlayer()) return

        if (aftermathExlusiveMobs.includes(source.actual.type)) {
            if(!entity.stages.has('witherKilled')){
                event.cancel();
            }
        }
    })
}

But I have no clue if its easily possible to make the mobs literally ignore the player, dont target him

mystic prairieBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

agile walrus
#

maybe the constructor for move and attack goals includes the entities to target

#

as for specific players, idk; you could use teams ?..

pale bobcat
#

you cant really edit AI behavior

#

or at least ive yet to see someone successfully do it

granite ferry
#

well that is unfortunate /:
is there a hacky way to achieve a similar thing? like with something like invisibility?

agile walrus
#

if ai goals and teams do not work, my immediate advice would be to make a forge mod with a new aigoal that you assign to relevant mobs when they spawn

granite ferry
#

(im using Fabric)

#

but if its doable in Fabric Ill think about it

#

havent worked with entities and AI yet

#

ill also first look into ai goals and teams
but teams like with the scoreboard system?