Badbird5907 / AntiCombatLog

https://ci.badbird5907.net/job/AntiCombatLog/
5 stars 7 forks source link

NPC name is random characters - messing up death messages #6

Closed sudokou closed 2 years ago

sudokou commented 2 years ago

Using version 2.1.0. Paper version:

You are 2 version(s) behind
Download the new version at: https://papermc.io/downloads
Previous version: git-Paper-152 (MC: 1.18.1)

Image shows issue:

image

Badbird5907 commented 2 years ago

Looks like a citizens thing and out of my control, image

Two potential solutions (that both include modifying your death messages plugin):

  1. Ask the author of your death messages plugin to add citizens support (pseudo code below)
  2. Ask the author of the death messages plugin to add AntiCombatLog as a softdepend and use CombatLogKillEvent (the UUID is supplied so they would need to call Bukkit.getOfflinePlayer(event.getPlayer()).getName()

Pseudo code for first solution:

    @EventHandler
    public void onKill(PlayerDeathEvent event) {
        if (event.getEntity().hasMetadata("NPC")) {
            String name = CitizensAPI.getNPCRegistry().getNPC(event.getEntity()).getName();
            //handle name here
        }
    }