Tools for working with entities.
local Entity = require('__stdlib__/stdlib/entity/entity')
has(entity, field_name) | Tests whether an entity has access to a given field. |
get_data(entity) | Gets the user data that is associated with an entity. |
set_data(entity, data) | Associates the user data to an entity. |
set_frozen(entity[, mode=true]) | Freezes an entity, by making it inactive, inoperable, and non-rotatable, or unfreezes by doing the reverse. |
set_indestructible(entity[, mode=true]) | Makes an entity indestructible so that it cannot be damaged or mined neither by the player nor by their enemy factions. |
_are_equal(entity_a, entity_b) | Tests if two entities are equal. |
Tests whether an entity has access to a given field.
Parameters: Returns:
Gets the user data that is associated with an entity.
The user data is stored in the global object and it persists between loads.
Parameters:The user data will be removed from an entity when the entity becomes invalid.
Associates the user data to an entity.
The user data will be stored in the global object and it will persist between loads.
Parameters:The user data will be removed from an entity when the entity becomes invalid.
Freezes an entity, by making it inactive, inoperable, and non-rotatable, or unfreezes by doing the reverse.
Parameters:
Makes an entity indestructible so that it cannot be damaged or mined neither by the player nor by their enemy factions.
Parameters: