- The server needs to be informed about damage that is both incoming on the player and outgoing from the player.
- The server in the default configuration will just reflect that damage and
- confirm the damage to the client (*) otherwise we could roll back the damage (think: godmode)
- relay the damage incident to other players, which will reduce the NPCs health accordingly.
*: The client should first accept the damage and only roll it back on demand, as this is a relatively rare use case. It's only about how other NPCs health appears to you as a player and about self-inflicted damage (e.g. fall damage).
Also: As hinted above with "default configuration", there will be server plugins that may influence how damage is calculated (maybe with a scalar factor, but more common will be preventing damage). Maybe we can also add a "immune" flag to handle the godmode use-cases relatively well.
*: The client should first accept the damage and only roll it back on demand, as this is a relatively rare use case. It's only about how other NPCs health appears to you as a player and about self-inflicted damage (e.g. fall damage).
Also: As hinted above with "default configuration", there will be server plugins that may influence how damage is calculated (maybe with a scalar factor, but more common will be preventing damage). Maybe we can also add a "immune" flag to handle the godmode use-cases relatively well.