query(e, 'id')

View on GitHub

Syntax

query(entity, 'id')

Returns numerical id of the entity. Most efficient way to keep track of entities in a script. Ids are only unique within current game session (ids are not preserved between restarts), and dimension (each dimension has its own ids which can overlap).