[NoAPI] Death messages and player language packs

Discussion in 'Plugin Development' started by _LB, Jul 18, 2014.

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

    _LB

    So I'm experimenting with PlayerDeathEvent and I'm noticing a problem with the API. In my language pack the default death message is "Player had items explode out of them" whereas the English US language is "Player died". I expected there to be some way to set which death message is used and give it the parameters it needs but I can't see any way to do this, as getDeathMessage just returns the English US death message and not a special message identifier string or anything.

    How do I use a predefined death message so it displays in the player's native language?
     
  2. Offline

    fireblast709

    _LB you can get the cause from getLastDamageCause(), the language can only be acquired from the client settings packet
     
  3. Offline

    _LB

    You don't understand, I have a custom language that the server can in no way ever know about.
     
  4. Offline

    Traks

    If you believe the server has no way to possibly know about it, why do you pose this question?
     
  5. Offline

    _LB

    Because the server can still tell my client to display a message from my language with certain parameters. How else do I even see the death message from my custom language? The server doesn't need to know what language I am using, it just needs to tell my client to use a string from my language.
     
  6. Offline

    Traks

    So first you ask you ask how to make the client interpret the death message in a custom language, then you say it's impossible for the server to know it and at last you say it already manifests the, by you, wanted behaviour?
     
  7. Offline

    _LB

    You seem to have misinterpreted every one of my posts.

    The server and client both already know about all the ways a player can die. When a player dies, the server tells all clients how that player died and with what parameters, and each client plugs in those parameters to the death message from their language for how that player died.

    The problem is that the getDeathMessage and setDeathMessage methods seem to be completely unaware that this sort of interaction is going on.
     
  8. Offline

    Traks

    I have basically written down there what you said... Don't quite understand how I can misinterpret something like that.... Either way, how would you even want such a method to be? In what language should the PlayerDeathEvent#getDeathMessage() return its message? If I edit the death message I expect it to be like that for every client, if I leave it unedited I expect the server to handle it accordingly to its own implementation.
     
  9. Offline

    _LB

    No, again you misunderstand. It should not actually return the deah message, but instead the ID of the death message from the language as well as the parameters fed to it. I'm looking for that API, since it doesn't seem to be part of PlayerDeathEvent.
     
  10. Offline

    maved145

    _LB Traks
    If I’m right, He means that he wants the language the client is using, which you can not get from PlayerDeathEvent.
     
  11. Offline

    _LB

    No, I do not want the language the client is using.
     
  12. Offline

    _LB

Thread Status:
Not open for further replies.

Share This Page