Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Petchy

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Petchy's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. 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); } } } }
  2. Update: setHasStung is still seen as private in the subscribe event, the change has not been recognised, how do I fix this?
  3. 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
  4. 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
  5. I'm trying to make cave spiders passive, how would I go about doing that?
  6. @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
  7. 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); } }
  8. 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 Privacy Policy.