Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

findOwningPlayer

findOwningPlayer(world, entity): PlayerEntity | null

The player whose page receives entity’s Reach.Owner traits, or null where none does: the player entity itself; else the first player entity up its setOwner chain, so a pet the player owns, or a sword the player’s pet owns, is the player’s. Else the player who controls it. An owner chain that names no player leaves it to its controller, and an entity with neither reaches no page. As Unreal’s GetNetOwner, which walks the owner chain to a player controller.

Parameter Type
world World
entity Entity

PlayerEntity | null

const owner = findOwningPlayer(world, chest);