With new version methods like goalSelector and targetSelector was disappeared. What should I replace them with? And, already from 1.16 I have problem with clearing bField. new UnsafeList<PathfinderGoalSelector>()) doesn't works. What should I replace this with too? Code: Code (Text): public void removePathFinders(Entity entity) { EntityCreature c = (EntityCreature) ((CraftEntity) entity).getHandle(); try { Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); bField.setAccessible(true); Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); cField.setAccessible(true); bField.set(c.goalSelector, new UnsafeList<PathfinderGoalSelector>()); bField.set(c.targetSelector, new UnsafeList<PathfinderGoalSelector>()); cField.set(c.goalSelector, new EnumMap<>(PathfinderGoal.Type.class)); cField.set(c.targetSelector, new EnumMap<>(PathfinderGoal.Type.class)); } catch (Exception exc) { exc.printStackTrace(); } }
Read annoucment of 1.17 at developers notes about nms, they reverted to obfuscates names of methods or something idk
I believe you are looking for this: bO and bP are the the goalSelector and targetSelector. I'm not sure which is which yet.
Doing this with Mojang mappings is much more fun. You can reobfuscate your jar afterwards using specialsource.
Thanks! It works...? I can't check it because i've this error when compiling project using maven: I am importing this class. This also applies to other similar package classes.