Repository: PaperMC/Paper
File: paper-api/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java (Java)

Code before:
        return LegacyComponentSerializer.legacySection().serializeOrNull(this.deathChatMessage);
    }

    /**
     * Set the death message that will appear in the chat.
     * <p>
     * If set to null, no message will be sent to chat.
     *
     * @param deathChatMessage Message to appear in the chat when the player dies.
     */
    public void deathChatMessage(@Nullable Component deathChatMessage) {
        this.deathChatMessage = deathChatMessage;
    }

    /**
     * Get the death message that will appear in the chat.
     *
     * @return Message to appear in chat.
     */
    public @Nullable Component deathChatMessage() {
        return this.deathChatMessage;
    }
    /**
     * Set the death message that will appear on the death screen of the dying player.
     * <p>
     * If set to null, no message will be shown to the dying player.
     * <p>
     * If the message exceeds 256 characters it will be truncated.
     *
     * @param deathScreenMessage Message to appear on the death screen to the dying player.
     */
    public void deathScreenMessage(@Nullable Component deathScreenMessage) {
        this.deathScreenMessage = deathScreenMessage;
    }

    /**
     * Get the death message that will appear on the death screen of the dying player.
     * By default, it is the same value as {@link #deathChatMessage()}.
     *
     * @return Message to appear on the death screen to the dying player.
     */
    public @Nullable Component deathScreenMessage() {
        return this.deathScreenMessage;
    }

    /**
     * Gets how much EXP the Player should have at respawn.
     * <p>
     * This does not indicate how much EXP should be dropped, please see
     * {@link #getDroppedExp()} for that.
     *

Review comment (suggestion):
```suggestion
     * @param deathChatMessage message to appear in the chat when the player dies.
```
below aswell

Code after:
        this.deathMessage = LegacyComponentSerializer.legacySection().deserializeOrNull(deathMessage);
    }

    /**
     * Get the death message that will appear to everyone on the server.
     *
     * @return Message to appear to other players on the server.
     * @deprecated in favour of {@link #deathMessage()}
     */
    @Nullable
    @Deprecated
    public String getDeathMessage() {
        return LegacyComponentSerializer.legacySection().serializeOrNull(this.deathMessage);
    }

    /**
     * Overrides the death message that will appear on the death screen of the dying player.
     * By default, this is null.
     * <p>
     * If set to null, death screen message will be same as {@code deathMessage()}.
     * <p>
     * If the message exceeds 256 characters it will be truncated.
     *
     * @param deathScreenMessageOverride Message to appear on the death screen to the dying player.
     */
    public void deathScreenMessageOverride(@Nullable Component deathScreenMessageOverride) {
        this.deathScreenMessageOverride = deathScreenMessageOverride;
    }

    /**
     * Get the death message override that will appear on the death screen of the dying player.
     * By default, this is null.
     * <p>
     * If set to null, death screen message will be same as {@code deathMessage()}.
     * <p>
     * @return Message to appear on the death screen to the dying player.
     */
    public @Nullable Component deathScreenMessageOverride() {
        return this.deathScreenMessageOverride;
    }

    /**
     * @return should experience be dropped from this death
     */
    public boolean shouldDropExperience() {
        return this.doExpDrop;
    }

    /**
     * @param doExpDrop sets if experience should be dropped from this death
     */