Information about the ENT structure, which represents a Scripted Entity class definition.
To learn more about scripted entities, see this page.
See also ENTITY Hooks for a list of events scripted entities can have. See Custom Entity Fields for a list of events and fields all entities can have.
While some of the fields may be serverside or clientside only, it is recommended to provide them on both so addons could use their values.
Values defined in ENT table can't be changed per instance. Initialize default values in
ENTITY:Initialize or other hook.
string BaseThe base entity to derive from. This must be a valid Lua entity
string TypeType of the entity. This
must be one of these:
- anim
- brush
- point
- ai
- nextbot
- filter
See Scripted Entities for a more detailed explanation of what each one is.
string ClassNameThe class name of the entity (File or folder name of your entity).
This is set automatically after the entity file is loaded.
string FolderThe folder from where the entity was loaded. This should always be "entity/ent_myentity", regardless whether your entity is stored as a file, or multiple files in a folder. This is set automatically before the entity file is loaded.
string CategorySpawnmenu category to put the entity into
Default: "Other"
boolean SpawnableWhether this entity should be displayed and is spawnable in the spawn menu
Default: false
boolean AdminOnlyWhether or not only admins can spawn the entity from their spawn menu
Default: false
string PrintNameNice name of the entity to appear in the spawn menu
Default: ""
boolean DoNotDuplicateIf set, the entity will not be duplicated via the built-in duplicator system.
Default: false
string IconOverrideIf set, overrides the icon path to be displayed in the Spawnmenu for this entity.
Like many functions, this expects a path relative to the materials/
folder, do not include materials/
in the provided string.
Default: "entities/<ClassName>.png"
number PhysicsSolidMaskIf set, a bitflag for the physics solidity of the entity. See
CONTENTS enum.
Can be used to make the entity pass though certain otherwise solid meshes, such as grates, or special clip brushes.
This only works for nextbot
, anim
and ai
type SENTs.
This was recently added in version (2024.07.20). It might only be available on the
Dev Branch right now.
Default: nil
boolean PhysicsSoundsFor
anim
type entities, if set, enables physics collision sounds.
This was recently added in version (2024.07.20). It might only be available on the
Dev Branch right now.
Default: false