Skip to content

Commit

Permalink
fix(chat): filter named entity death messages
Browse files Browse the repository at this point in the history
  • Loading branch information
axieum committed Aug 28, 2021
1 parent 8b0f723 commit b916d80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -16,6 +16,9 @@ public class EntityDeathCallback implements EntityDeathEvents.Entity
@Override
public void onEntityDeath(LivingEntity entity, DamageSource source)
{
// Only listen for named animal/monsters (with a name tag)
if (!entity.hasCustomName()) return;

Minecord.getInstance().getJDA().ifPresent(jda -> {
final String entityName = entity.getDisplayName().getString();

Expand Down
Expand Up @@ -45,7 +45,7 @@ public static class Discord
@Comment("""
A player had died
Usages: ${username}, ${player}, ${cause}, ${world}, ${x}, ${y}, ${z}, ${score} and ${exp}""")
public String death = "**${player}** ${cause}!\n:skull: _${world} | ${x}, ${y}, ${z}_";
public String death = "**${player}** ${cause}! :skull:\n_${world} | ${x}, ${y}, ${z}_";

@Comment("""
A named animal/monster (with name tag) had died
Expand Down

0 comments on commit b916d80

Please sign in to comment.