Garry's Mod Wiki

Revision Difference

Structures/ENT#561933

<structure> <realm>Shared</realm> <description> Information about the ENT structure. Information about the ENT structure, which represents a Scripted Entity class definition. To learn more about scripted entities, <page text="see this page">Scripted_Entities</page>. ⤶ See also <page>ENTITY Hooks</page> for a list of events scripted entities can have. See <page>Custom Entity Fields</page> 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. <note>Values defined in ENT table can't be changed per instance. Initialize default values in <page>ENTITY:Initialize</page> or other hook.</note> </description> <fields> <item name="Base" type="string">The base entity to derive from. This **must** be a valid Lua entity</item> <item name="Type" type="string">Type of the entity. This **must** be one of these: * **anim** * **brush** * **point** * **ai** * **nextbot** * **filter** See <page>Scripted Entities</page> for a more detailed explanation of what each one is.</item> <item name="ClassName" type="string">The class name of the entity (File or folder name of your entity). **This is set automatically _after_ the entity file is loaded.**</item> <item name="ClassNameOverride" type="string" added="2023.09.29">If set, overrides the classname of the SWEP.</item> <item name="Folder" type="string">The 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.**</item> <item name="AutomaticFrameAdvance" type="boolean" default="false">Set this to true if your entity has animations. You should also apply changes to the <page>ENTITY:Think</page> function from the example on that page.</item> <item name="Category" type="string" default="Other" realm="client">Spawnmenu category to put the entity into</item> <item name="Spawnable" type="boolean" default="false">Whether this entity should be displayed and is spawnable in the spawn menu</item> <item name="Editable" type="boolean" default="false">Whether the entity supports Editing. See <page>Editable Entities</page> for more info.</item> <item name="AdminOnly" type="boolean" default="false">Whether or not only admins can spawn the entity from their spawn menu</item> <item name="PrintName" type="string" default="" realm="client">Nice name of the entity to appear in the spawn menu</item> <item name="Author" type="string" default="" realm="client">The author of the entity</item> <item name="Contact" type="string" default="" realm="client">The contacts of the entity creator</item> <item name="Purpose" type="string" default="" realm="client">The purpose of the entity creation</item> <item name="Instructions" type="string" default="" realm="client"> How to use your entity</item> <item name="RenderGroup" type="number" realm="client">The entity's render group, see <page>Enums/RENDERGROUP</page>. If unset, the engine will decide the render group based on the entity's model.</item> <item name="WantsTranslucency" type="boolean" realm="client" default="false">If set and RenderGroup is not, will switch the render group to <page text="RENDERGROUP_BOTH">Enums/RENDERGROUP#RENDERGROUP_BOTH</page> when appropriate.</item> <item name="DisableDuplicator" type="boolean" default="false" realm="server">Disable the ability for players to duplicate this entity.</item> <item name="ScriptedEntityType" type="string" default="" realm="client">Sets the spawnmenu content icon type for the entity, used by spawnmenu in the Sandbox-derived gamemodes. See <page>spawnmenu.AddContentType</page> for more information.</item> <item name="DoNotDuplicate" type="boolean" default="false" realm="server">If set, the entity will not be duplicated via the built-in duplicator system.</item> <item name="IconOverride" type="string" default="entities/<ClassName>.png" realm="client">If 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. </item> <item name="PhysgunDisabled" type="boolean" default="false">If set, the entity forbid physgun interaction.</item> </fields> </structure>