Posted December 10, 20195 yr I'm trying and failing with this: @SubscribeEvent public void zombieSpawn(EntityJoinWorldEvent event) { if (isRemoveZombieGoal()) { World world = event.getEntity().world; if (!world.isRemote) { if (event.getEntity() instanceof ZombieEntity) { System.out.println("should remove"); ZombieEntity zombie = (ZombieEntity) event.getEntity(); zombie.targetSelector.removeGoal(new NearestAttackableTargetGoal<>(zombie, PlayerEntity.class, true)); zombie.goalSelector.removeGoal(new ZombieAttackGoal(zombie, 1.0D, false)); } } } } What am I doing wrong here. I do get console message.
December 10, 20195 yr You're calling new on an object that likely does not have equals overridden, which means that the two will never be equal. You will need to iterate over the array and remove it via identification. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.