From 4ca0b783da3b2bdaf11e645b60e412bb27fc40f7 Mon Sep 17 00:00:00 2001 From: Dylan Xaldin Date: Thu, 12 Dec 2013 18:05:03 -0600 Subject: [PATCH] Allow Disabling Zombie Villager Aggression Ability to configure if Zombies will be aggressive towards Villagers. diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java index 8264cac..c2913d6 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -47,7 +47,7 @@ public class EntityZombie extends EntityMonster { this.goalSelector.a(6, new PathfinderGoalMoveThroughVillage(this, 1.0D, false)); this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, true, new Class[] { EntityPigZombie.class})); this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, true)); - this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false)); + if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false)); // Spigot this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityIronGolem.class, true)); } diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java index 5548d3e..f9c01cb 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -207,4 +207,11 @@ public class SpigotWorldConfig arrowDespawnRate = getInt( "arrow-despawn-rate", 1200 ); log( "Arrow Despawn Rate: " + arrowDespawnRate ); } + + public boolean zombieAggressiveTowardsVillager; + private void zombieAggressiveTowardsVillager() + { + zombieAggressiveTowardsVillager = getBoolean( "zombie-aggressive-towards-villager", true ); + log( "Zombie Aggressive Towards Villager: " + zombieAggressiveTowardsVillager ); + } } -- 2.7.4