mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
option to make ravagers afraid of rabbits
https://github.com/PurpurMC/Purpur/discussions/713
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -2493,6 +2493,7 @@ public class PurpurWorldConfig {
|
||||
public boolean ravagerTakeDamageFromWater = false;
|
||||
public List<Block> ravagerGriefableBlocks = new ArrayList<>();
|
||||
public boolean ravagerAlwaysDropExp = false;
|
||||
public boolean ravagerAvoidRabbits = false;
|
||||
private void ravagerSettings() {
|
||||
ravagerRidable = getBoolean("mobs.ravager.ridable", ravagerRidable);
|
||||
ravagerRidableInWater = getBoolean("mobs.ravager.ridable-in-water", ravagerRidableInWater);
|
||||
@@ -2524,6 +2525,7 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
});
|
||||
ravagerAlwaysDropExp = getBoolean("mobs.ravager.always-drop-exp", ravagerAlwaysDropExp);
|
||||
ravagerAvoidRabbits = getBoolean("mobs.ravager.avoid-rabbits", ravagerAvoidRabbits);
|
||||
}
|
||||
|
||||
public boolean salmonRidable = false;
|
||||
|
||||
Reference in New Issue
Block a user