Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SubscribeEvent
- public static void entityGoalEvent(final EntityJoinWorldEvent event) {
- Entity entity = event.getEntity();
- if (entity instanceof CreeperEntity) {
- CreeperEntity creeperEntity = (CreeperEntity) entity;
- Set<PrioritizedGoal> targetGoals = ObfuscationReflectionHelper.getPrivateValue(GoalSelector.class,
- creeperEntity.targetSelector, "goals");
- Iterator<PrioritizedGoal> i = targetGoals.iterator();
- while (i.hasNext()) {
- i.next();
- i.remove();
- }
- creeperEntity.targetSelector.addGoal(1, new DanceGoal(creeperEntity));
- creeperEntity.targetSelector.addGoal(3, new HurtByTargetGoal(creeperEntity));
- creeperEntity.addPotionEffect(new EffectInstance(Effects.GLOWING, 99999));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement