Skip to content

Commit

Permalink
Configurable zombie movement speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Dec 18, 2023
1 parent 51f2561 commit b0774da
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions patches/server/0042-Configurable-zombie-movement-speed.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Sun, 17 Dec 2023 19:34:46 -0500
Subject: [PATCH] Configurable zombie movement speed


diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 007e75ec5a6a8f1522e7f0d105507834028eb819..ef788ff5b2c7e0550ee60054cbceb2bf81f5d086 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -185,9 +185,16 @@ public class Zombie extends Monster {
this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR));
}

- public static AttributeSupplier.Builder createAttributes() {
- return Monster.createMonsterAttributes().add(Attributes.FOLLOW_RANGE, 35.0D).add(Attributes.MOVEMENT_SPEED, 0.23000000417232513D).add(Attributes.ATTACK_DAMAGE, 3.0D).add(Attributes.ARMOR, 2.0D).add(Attributes.SPAWN_REINFORCEMENTS_CHANCE);
- }
+ // Leaf start - Configurable zombie movement speed
+ public AttributeSupplier.Builder createAttributes() {
+ return Monster.createMonsterAttributes()
+ .add(Attributes.FOLLOW_RANGE, 35.0D)
+ .add(Attributes.MOVEMENT_SPEED, this.level().purpurConfig.zombieMovementSpeed)
+ .add(Attributes.ATTACK_DAMAGE, 3.0D)
+ .add(Attributes.ARMOR, 2.0D)
+ .add(Attributes.SPAWN_REINFORCEMENTS_CHANCE);
+ }
+ // Leaf end

@Override
protected void defineSynchedData() {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 22a61c89007e624586e7ed518f0aa18372bc4593..adbabe81f0d23f9fbe61303c069a5765e9acfdb6 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -3126,6 +3126,7 @@ public class PurpurWorldConfig {
public boolean zombieTakeDamageFromWater = false;
public boolean zombieAlwaysDropExp = false;
public double zombieHeadVisibilityPercent = 0.5D;
+ public double zombieMovementSpeed = 0.2D; // Leaf - Configurable zombie movement speed
private void zombieSettings() {
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
@@ -3145,6 +3146,7 @@ public class PurpurWorldConfig {
zombieTakeDamageFromWater = getBoolean("mobs.zombie.takes-damage-from-water", zombieTakeDamageFromWater);
zombieAlwaysDropExp = getBoolean("mobs.zombie.always-drop-exp", zombieAlwaysDropExp);
zombieHeadVisibilityPercent = getDouble("mobs.zombie.head-visibility-percent", zombieHeadVisibilityPercent);
+ zombieMovementSpeed = getDouble("mobs.zombie.movement-speed", zombieMovementSpeed); // Leaf - Configurable zombie movement speed
}

public boolean zombieHorseRidable = false;

0 comments on commit b0774da

Please sign in to comment.