Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…r-MCreator into 1.20.1
  • Loading branch information
Goldorion committed Feb 3, 2024
2 parents c148af2 + 677d490 commit 1956cbf
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/fabric-1.20.1/procedures/entity_deal_custom_damage.java.ftl
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
if (${input$entity} instanceof LivingEntity _entity)
_entity.hurt(new DamageSource(_entity.level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.GENERIC)) {
_entity.hurt(new DamageSource(_entity.level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.GENERIC)){
@Override public Component getLocalizedDeathMessage(LivingEntity _msgEntity) {
return Component.translatable("death.attack." + ${input$localization_text});
String _translatekey = "death.attack." + ${input$localization_text};
if (this.getEntity() == null && this.getDirectEntity() == null) {
return _msgEntity.getKillCredit() != null ?
Component.translatable(_translatekey + ".player", _msgEntity.getDisplayName(), _msgEntity.getKillCredit().getDisplayName()) :
Component.translatable(_translatekey, _msgEntity.getDisplayName());
} else {
Component _component = this.getEntity() == null ? this.getDirectEntity().getDisplayName() : this.getEntity().getDisplayName();
ItemStack _itemstack = ItemStack.EMPTY;
if (this.getEntity() instanceof LivingEntity _livingentity)
_itemstack = _livingentity.getMainHandItem();
return !_itemstack.isEmpty() && _itemstack.hasCustomHoverName() ?
Component.translatable(_translatekey + ".item", _msgEntity.getDisplayName(), _component, _itemstack.getDisplayName()) :
Component.translatable(_translatekey, _msgEntity.getDisplayName(), _component);
}
}
}, ${opt.toFloat(input$damage_number)});
}, ${opt.toFloat(input$damage_number)});

0 comments on commit 1956cbf

Please sign in to comment.