setPlayerFlag

fun setPlayerFlag(key: String, value: String)

Sets a player flag to a specific value.

This method creates or updates a player flag with the given value. The operation automatically marks the data as dirty to ensure the change is persisted to the database.

Usage Examples:

playerData.setPlayerFlag("quest_tutorial_complete", "true")
playerData.setPlayerFlag("player_class", "mage")
playerData.setPlayerFlag("last_login_bonus", "2023-12-01")

Side Effects:

  • Creates the flag if it doesn't exist

  • Updates the flag if it already exists

  • Marks the PlayerData as dirty for database persistence

  • May trigger PlayerFlagSetEvent in other system components

Parameters

key

The flag name/key to set

value

The value to assign to the flag

See also