option to make ravagers afraid of rabbits

https://github.com/PurpurMC/Purpur/discussions/713
This commit is contained in:
granny
2025-01-12 18:04:06 -08:00
committed by granny
parent c935de147d
commit 194d9685b2
3 changed files with 10 additions and 39 deletions

View File

@@ -1,5 +1,13 @@
--- a/net/minecraft/world/entity/monster/Ravager.java
+++ b/net/minecraft/world/entity/monster/Ravager.java
@@ -70,6 +_,7 @@
protected void registerGoals() {
super.registerGoals();
this.goalSelector.addGoal(0, new FloatGoal(this));
+ if (level().purpurConfig.ravagerAvoidRabbits) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.AvoidEntityGoal<>(this, net.minecraft.world.entity.animal.Rabbit.class, 6.0F, 1.0D, 1.2D)); // Purpur - option to make ravagers afraid of rabbits
this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0, true));
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.4));
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
@@ -150,7 +_,7 @@
)) {
BlockState blockState = serverLevel.getBlockState(blockPos);