Reference/Datatypes/EntitySearchEntry
Datatype · Structs

EntitySearchEntry

struct

Search-entry definition consumed by entity.add_search_entry / entity.update_search_entry. Describes how to walk the DataModel from a known anchor and which descendants qualify as entities.

Exactly one of EntityRelation, Team, or TeamScanContext must be supplied. EntityRelation is the simplest form: a single Enum value synthesises a default Team for you. Team is for static team membership; TeamScanContext is for dynamic team assignment driven by a second validator tree.

Fields

NameTypeDescription
EntityKindEntityKind

Classification applied to matched descendants: NPC, Player, or Unknown.

EntityRelationEntityRelation?

Shortcut: pick Self, Enemy, Teammate, or Neutral and a default Team is synthesised for you. Mutually exclusive with Team and TeamScanContext.

EvaluationDistancenumber?

Optional max distance (in studs) from the local character. 0 disables the gate.

FirstValidChildboolean

When true, stop at the first descendant that passes the validator tree. When false, sweep all matches.

Idstring

Stable unique id. Duplicates are rejected with EntityActionResult.DuplicateId. Pass this back to remove_search_entry / update_search_entry.

IgnoredNames{ string }?

Optional leaf names to skip while walking SearchPath.

Namestring

Human-readable label used in overlays and logs.

ScanValidatorTree{ ValidatorEntry }

Chain of validator predicates AND-ed in order. Every entry must pass for the descendant to qualify.

SearchModeEntitySearchMode

Walk order: BFS, DFS, or First. First is shorthand for FirstValidChild semantics.

SearchPathstring

Dotted DataModel path to begin the descent at, e.g. Workspace.Enemies.

TeamEntityTeamSpec?

Static team rule. Mutually exclusive with EntityRelation and TeamScanContext.

TeamScanContextEntityTeamScanContext?

Dynamic team rule driven by a second validator tree. Mutually exclusive with EntityRelation and Team.