Set an entity name 1.5

Discussion in 'Plugin Development' started by filoghost, Mar 25, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    filoghost

    I have a plugin that displays health bar over mob heads, as custom name. If someone get killed by a mob with health bar, in chat appears the health bar as killer. How can I change a mob name when a player gets killed by a mob, but before the death message is printed on chat?
     
  2. Offline

    AmShaegar

  3. Offline

    filoghost

    I would like to change entity name for other plugin that uses death messages...EntityDamageByEntityEvent is called before PlayerDeathEvent?
     
  4. Offline

    AmShaegar

    Yea but you would need to calculate if the player will die. This includes armor which has to be calculated completly manually afaik. How do you set the new name of the entities?
     
  5. Offline

    filoghost

    mob.setCustomName(string)

    So I cannot set an entity name before death message?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  6. Offline

    AmShaegar

    Well, you could. Currently, I am testing. I assume you can change the name back to normal on PlayerDeath and reset it to your health bar after all events are processed.

    Well... That does not work. The death message is already set when the on death event is called.
     
  7. Offline

    filoghost

    I will replace death message, no escape
     
  8. Offline

    raGan.

    Make that a "feature", make death message configurable. :p
     
  9. Offline

    filoghost

    Nice idea! But with the new 1.5 death messages I'm unable to get the lastCauseDamage! For example with this "Player walked into a fire whilst fighting ---" the cause of death is fire, and not the mob :(
     
  10. Offline

    AmShaegar

    Which is correct, no? If you want the last mob that made damage you would need to save that one for every player. You can get it from the EntityDamageByEntityEvent
     
  11. Offline

    filoghost

    Too complicated, I just replaced death messages, if they contains a weird charater from health bar :) thank you however :)
     
  12. Please use EntityType instead of instanceof.
     
  13. Offline

    filoghost

    Why?
     
    AmShaegar likes this.
Thread Status:
Not open for further replies.

Share This Page