Add configurable snowball damage

This commit is contained in:
William Blake Galbreath
2025-01-09 20:34:57 -08:00
committed by granny
parent 4346cee03f
commit 54b81f2b74
3 changed files with 16 additions and 35 deletions

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/world/entity/projectile/Snowball.java
+++ b/net/minecraft/world/entity/projectile/Snowball.java
@@ -52,7 +_,7 @@
protected void onHitEntity(EntityHitResult result) {
super.onHitEntity(result);
Entity entity = result.getEntity();
- int i = entity instanceof Blaze ? 3 : 0;
+ int i = entity.level().purpurConfig.snowballDamage >= 0 ? entity.level().purpurConfig.snowballDamage : entity instanceof Blaze ? 3 : 0; // Purpur - Add configurable snowball damage
entity.hurt(this.damageSources().thrown(this, this.getOwner()), i);
}

View File

@@ -330,6 +330,11 @@ public class PurpurWorldConfig {
});
}
public int snowballDamage = -1;
private void snowballSettings() {
snowballDamage = getInt("gameplay-mechanics.projectile-damage.snowball", snowballDamage);
}
public boolean anvilAllowColors = false;
public boolean anvilColorsUseMiniMessage;
private void anvilSettings() {