Jump to content

Petchy

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Petchy

  1. I'm attempting to make the bee entity setHasStung() method public, however I can't seem to get the access transformer to work, what should I put in the accesstransformer.cfg file to accomplish this? Thanks so much Edit: nvm figured it out
  2. Hi, i'm trying to make it so that wolves will not attack other mobs when untamed, i'm aware im probably doing it totally wrong, but I can't figure out how to make this work: @SubscribeEvent public static void wolfNoChase(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Wolf) { ((Wolf) e.getEntity()).targetSelector.removeGoal(NonTameRandomTargetGoal); } } Please could I be given some pointers or shown an example of how to do this properly? Thank you so much I also tried this (doesnt work either): @SubscribeEvent public static void wolfNoChase(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Wolf) { for(Goal goal: ((Wolf) e.getEntity()).targetSelector.getAvailableGoals()) { if (goal instanceof NonTameRandomTargetGoal) { ((Wolf) e.getEntity()).targetSelector.removeGoal(goal); } } } }
  3. Update: setHasStung is still seen as private in the subscribe event, the change has not been recognised, how do I fix this?
  4. public void setHasStung(boolean p_27926_) { this.setFlag(4, p_27926_); } I have set setHasStung to public, however it still seems to not let me call the method. I'm trying to make it so that bees can sting you, but will not lose their stinger and die: @SubscribeEvent public static void unSting(LivingHurtEvent e) { if (e.getSource().getEntity() instanceof Bee) { ((Bee)e.getSource().getEntity()).setHasStung(false); } } setHasStung is just underlined red, can anyone explain this? Thank you
  5. How would I make it so that bees no longer become aggressive under any circumstance, I can't seem to figure it out. thanks so much
  6. I'm trying to make cave spiders passive, how would I go about doing that?
  7. @EventHandler public void attack(LivingDamageEvent event) { if (event.getEntity() instanceof EntityCow) { event.setCanceled(true); } } I'm new to minecraft mods, why does this not trigger when I hit a cow and cancel the damage? Thank you
  8. Can I just ask, I wrote this quick code, should this not work? It doesn't seem to: @EventHandler public void attack(LivingDamageEvent event) { if (event.getEntity() instanceof EntityCow) { event.setCanceled(true); } }
  9. How do I access the mobs (specifically passive animals) in order to modify them, making them invincible for example. I'm new to minecraft modding. Thanks so much for any help.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.