DiscordSRV

DiscordSRV

86.8k Downloads

Pet death messages

kyleawayan opened this issue ยท 2 comments

commented

Why?

Thank you for the amazing plugin!

It would be nice to have pet death messages along with player ones.

What and How?

Like the player death messages, have one for pets.

Are there alternatives?

There's another plugin that announces death messages in Discord, and it has support for pet death messages.

Checks

  • I have used the search at least once to check if my idea has already been suggested and perhaps already implemented.

Anything else

No response

commented

I'm going to wager a guess that this is something that will not be added to the plugin but it can be accomplished by using out alerts module, join our Discord for more information: https://discord.gg/He68XwZH

commented

For now, I'm using a custom alert. @BoredManCodes made an alert (thank you!) for pet death messages on the Discord. I modified it a bit, and here is the custom alert:

# If the pet has no name and was killed by a player
- Trigger: EntityDeathEvent
  Channel: global
  Conditions:
    - "#event.getEntity().getCustomName() == null"
    - "#event.getEntity().getOwner() != null"
    - "#event.getEntity().getKiller() != null"
  Content: "${#event.getEntity().getOwner().getName()}'s ${#event.getEntity().getType().toString().toLowerCase()} was killed by ${#event.getEntity().getKiller().getName()}"

# If the pet has no name but was not killed by a player (fall, etc.)
- Trigger: EntityDeathEvent
  Channel: global
  Conditions:
    - "#event.getEntity().getCustomName() == null"
    - "#event.getEntity().getOwner() != null"
    - "#event.getEntity().getKiller() == null"
  Content: "${#event.getEntity().getOwner().getName()}'s ${#event.getEntity().getType().toString().toLowerCase()} was killed by ${#event.getEntity().getLastDamageCause().getCause().toString().toLowerCase()}"

# If it is any animal with a name tag that was killed by a player
- Trigger: EntityDeathEvent
  Channel: global
  Conditions:
    - "#event.getEntity().getCustomName() != null"
    - "#event.getEntity().getKiller() != null"
  Content: "${#event.getEntity().getCustomName()} was killed by ${#event.getEntity().getKiller().getName()}"

# If it is any animal with a name tag that was not killed by a player (fall, etc.)
- Trigger: EntityDeathEvent
  Channel: global
  Conditions:
    - "#event.getEntity().getCustomName() != null"
    - "#event.getEntity().getKiller() == null"
  Content: "${#event.getEntity().getCustomName()} was killed by ${#event.getEntity().getLastDamageCause().getCause().toString().toLowerCase()}"

Screen Shot 2022-02-02 at 10 13 00 PM

It's not perfect, as it doesn't exactly replicate the wording of the death message on Minecraft. I looked through the documentation for EntityDeathEvent but couldn't find anything to return the actual death message.

Also for my server, I commented out the first two alerts where getOwner() is used, since animals dying without the ability to have an owner fills the Minecraft logs with errors. I'm fine with disabling death messages with pets with no name tags for now.

Even though this alert does the job, it would be nice to have this natively though in the plugin (and maybe even reflect the exact wording of Minecraft's pet death messages!)