mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
fix one punch not working correctly on hostile & passive mobs
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] One Punch Man!
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index dc1c7c55fd13cc1a8ade803bfb1b7c385cf29132..0b4384b6898ad591b8b9256b2427359474dd9c57 100644
|
||||
index dc1c7c55fd13cc1a8ade803bfb1b7c385cf29132..523052af43aa86982d2ded0cc0882d34bac24da7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2382,6 +2382,21 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -18,9 +18,9 @@ index dc1c7c55fd13cc1a8ade803bfb1b7c385cf29132..0b4384b6898ad591b8b9256b24273594
|
||||
+ double attackDamage;
|
||||
+ net.minecraft.world.item.component.ItemAttributeModifiers itemattributemodifiers = player.getMainHandItem().getOrDefault(DataComponents.ATTRIBUTE_MODIFIERS, net.minecraft.world.item.component.ItemAttributeModifiers.EMPTY);
|
||||
+
|
||||
+ attackDamage = itemattributemodifiers.compute(this.getAttributeBaseValue(Attributes.ATTACK_DAMAGE), EquipmentSlot.MAINHAND);
|
||||
+ attackDamage = itemattributemodifiers.compute(player.getAttributeBaseValue(Attributes.ATTACK_DAMAGE), EquipmentSlot.MAINHAND);
|
||||
+
|
||||
+ if (attackDamage == 0) {
|
||||
+ if (attackDamage == 1.0D) {
|
||||
+ this.setHealth(0);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user