修改击杀提示信息格式

This commit is contained in:
17146 2024-05-18 23:58:37 +08:00
parent b5de7df1ec
commit 88244fe54b

View file

@ -47,6 +47,8 @@ public class TargetModDamageTypes {
Entity entity = this.getDirectEntity() == null ? this.getEntity() : this.getDirectEntity();
if (entity == null) {
return Component.translatable("death.attack." + this.getMsgId(), pLivingEntity.getDisplayName());
} else if (entity instanceof LivingEntity living && living.getMainHandItem().hasCustomHoverName()) {
return Component.translatable("death.attack." + this.getMsgId() + ".item", pLivingEntity.getDisplayName(), entity.getDisplayName(), living.getMainHandItem().getDisplayName());
} else {
return Component.translatable("death.attack." + this.getMsgId() + ".entity", pLivingEntity.getDisplayName(), entity.getDisplayName());
}