-
1.19 access transformer
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
-
[1.18.1] How to remove goal from entity
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); } } } }
-
[1.18.1] Cannot access method made public through access transformer
Update: setHasStung is still seen as private in the subscribe event, the change has not been recognised, how do I fix this?
-
[1.18.1] Cannot access method made public through access transformer
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
-
Stop bee aggression
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
-
How to make an aggressive mob passive
I'm trying to make cave spiders passive, how would I go about doing that?
-
Modifying existing mobs
@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
-
Modifying existing mobs
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); } }
-
Modifying existing mobs
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.
IPS spam blocked by CleanTalk.