This is my code so far but it doesn't seem to work
private static void changeAI(CreeperEntity entity) {
if (entity.world != null && !entity.world.isRemote) {
Set<PrioritizedGoal> goals = ObfuscationReflectionHelper.getPrivateValue(GoalSelector.class, entity.goalSelector, "goals");
ChangeMod.LOGGER.info(goals);
for (PrioritizedGoal goal: goals) {
if (goal.getGoal() instanceof AvoidEntityGoal) {
entity.goalSelector.removeGoal(goal);
ChangeMod.LOGGER.info(goal.getGoal().toString());
}
}
goals = ObfuscationReflectionHelper.getPrivateValue(GoalSelector.class, entity.goalSelector, "goals");
ChangeMod.LOGGER.info(goals);
}
}
But the creepers still avoid them and the goals are the same length