core / pragma.playerdata / PlayerDataSnapshot /

PlayerDataSnapshot #

class PlayerDataSnapshot(entityData: EntityData, uuidProxy: UUIDProxy = UUIDProxy.defaultInstance)

Provides access to a player’s Entities and provides functions to add, update, and delete.

Constructors #

PlayerDataSnapshot

fun PlayerDataSnapshot(entityData: EntityData, uuidProxy: UUIDProxy = UUIDProxy.defaultInstance)

Functions #

NameSummary

getOrCreateUniqueEntity

fun getOrCreateUniqueEntity(name: String, getComponents: () -> List<Component> = ::emptyList): Entity

Will throw a pragma.ApplicationErrorException if there are multiple entities assigned the provided name, or if the underlying Entity has a corrupted EntityId

getUnderlyingEntityData

fun getUnderlyingEntityData(): EntityData

Returns the underlying structure EntityData

getUniqueEntity

fun getUniqueEntity(name: String): Entity?

Will throw a pragma.ApplicationErrorException if there are multiple entities assigned the provided name.