修改击杀提示信息格式
This commit is contained in:
parent
b5de7df1ec
commit
88244fe54b
1 changed files with 2 additions and 0 deletions
|
@ -47,6 +47,8 @@ public class TargetModDamageTypes {
|
||||||
Entity entity = this.getDirectEntity() == null ? this.getEntity() : this.getDirectEntity();
|
Entity entity = this.getDirectEntity() == null ? this.getEntity() : this.getDirectEntity();
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
return Component.translatable("death.attack." + this.getMsgId(), pLivingEntity.getDisplayName());
|
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 {
|
} else {
|
||||||
return Component.translatable("death.attack." + this.getMsgId() + ".entity", pLivingEntity.getDisplayName(), entity.getDisplayName());
|
return Component.translatable("death.attack." + this.getMsgId() + ".entity", pLivingEntity.getDisplayName(), entity.getDisplayName());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue