ent_create
Jump to navigation
Jump to search
![English (en) English (en)](/w/images/3/37/Flag-en.png)
Note:This command is flagged as a cheat in
Black Mesa in all game modes.
Note:In games based on
Portal 2 engine branch or
Left 4 Dead engine branch it is not possible to set entity's keyvalues with this command, only <entity name> is accepted as argument.
Workaround:Use addoutput input with ent_fire command to add keyvalues. (this won't always work as intended because certain keyvalues take effect only during the entity spawning)
Tip:To find out the combo, create such an entity and edit its flags in Hammer, then disable SmartEdit and copy the
![English (en) English (en)](/w/images/3/37/Flag-en.png)
![Translate (Translate) Translate (Translate)](/w/images/a/a8/Flag-Translate.png)
ent_create
is a console command available in all Source games.
It creates an entity of the given type where the player is looking.
![Note.png](/w/images/thumb/c/cc/Note.png/10px-Note.png)
![Black Mesa](/w/images/thumb/3/31/Bms_icon.png/16px-Bms_icon.png)
Usage
Syntax: ent_create <entity name> <param 1 name> <param 1> <param 2 name> <param 2>...<param N name> <param N>
![Note.png](/w/images/thumb/c/cc/Note.png/10px-Note.png)
![Portal 2 engine branch](/w/images/thumb/3/3c/Portal2_icon.png/16px-Portal2_icon.png)
![Left 4 Dead engine branch](/w/images/thumb/a/ad/Icon-L4D.png/16px-Icon-L4D.png)
Todo: When was this added and what games is it available in?
![PlacementTip.png](/w/images/thumb/c/cc/PlacementTip.png/14px-PlacementTip.png)
Examples
- ent_create player_speedmod; ent_fire player_speedmod ModifySpeed 3
- A handy way to make the player faster ingame, without needing to recompile the map or using host_timescale.
- ent_create env_explosion targetname newexp iMagnitude 100; ent_fire newexp explode
- Spawns an explosion where the player looks and instantly triggers it too.
- ent_create prop_dynamic model models/editor/playerstart.mdl modelscale 2
- Example of creating a prop. Alternatively, prop_dynamic_create can be used.
- ent_create player_weaponstrip targetname pacifism; ent_fire pacifism strip
- A handy way to clear weapons ingame.
Flags
You can also pass flags to created entities like this: Syntax: ent_create <entity name> spawnflags <combo>
- ent_create point_viewcontrol spawnflags 264 angles "0 0 90"
- creates a 90 flipped point_viewcontrol that does not start at/follow the player and has an infinite hold time. For an understanding of angles, see getpos.
![Tip.png](/w/images/thumb/4/45/Tip.png/9px-Tip.png)
spawnflags
value.See also
- prop_dynamic_create, a command to spawn a model ingame.
- give, a command like ent_fire, but things spawn beneath the player's feet.