package net.minecraft.world.damagesource;

import net.minecraft.network.chat.Style;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.HoverEvent;
import net.minecraft.network.chat.ClickEvent;
import net.minecraft.network.chat.ComponentUtils;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.LivingEntity;

public class BadRespawnPointDamage extends DamageSource {
    protected BadRespawnPointDamage() {
        super("badRespawnPoint");
        this.setScalesWithDifficulty();
        this.setExplosion();
    }
    
    @Override
    public Component getLocalizedDeathMessage(final LivingEntity aoy) {
        final HoverEvent mv;
        final Style style;
        final Component mr3 = ComponentUtils.wrapInSquareBrackets(new TranslatableComponent("death.attack.badRespawnPoint.link")).withStyle(nb -> {
            nb.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://bugs.mojang.com/browse/MCPE-28723"));
            new HoverEvent((HoverEvent.Action<TextComponent>)HoverEvent.Action.SHOW_TEXT, new TextComponent("MCPE-28723"));
            return style.withHoverEvent(mv);
        });
        return new TranslatableComponent("death.attack.badRespawnPoint.message", new Object[] { aoy.getDisplayName(), mr3 });
    }
}
