Skip to content

Commit

Permalink
Added Mace into weapon list to fix wrong death message killed by Mace
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Dec 16, 2024
1 parent 635157d commit 85a1ec0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public static boolean isWeapon(ItemStack itemStack) {
|| itemMaterialIsWeapon(itemStack);
}

// Refer https://minecraft.wiki/w/Weapon
// Or https://zh.minecraft.wiki/w/%E6%AD%A6%E5%99%A8
public static boolean isWeapon(Material material) {
String materialName = material.toString();
return materialName.contains("SHOVEL")
Expand All @@ -69,7 +71,8 @@ public static boolean isWeapon(Material material) {
|| materialName.contains("BOW")
|| materialName.contains("CROSSBOW")
|| materialName.contains("ARROW")
|| materialName.contains("TRIDENT");
|| materialName.contains("TRIDENT")
|| materialName.contains("MACE");
}

public static boolean hasWeapon(LivingEntity mob, EntityDamageEvent.DamageCause damageCause) {
Expand Down

0 comments on commit 85a1ec0

Please sign in to comment.