EntityJSEvents.addGoals('minecraft:enderman', event => {
    let Player = Java.loadClass('net.minecraft.world.entity.player.Player')
   
    const NearestAttackableTargetGoal = Java.loadClass('net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal')
    event.entity.targetSelector.addGoal(1, new NearestAttackableTargetGoal(event.entity, Player, true))
})