entities.entity module¶
Provides a class used to interact with a specific entity.
- class entities.entity.BaseEntity¶
Bases:
ServerEntity
- classmethod create((object)arg1, (str)arg2) object : ¶
Create an entity by its class name.
- Return type:
- classmethod find((object)arg1, (str)arg2) object : ¶
Return the first entity that has a matching class name.
- Return type:
- classmethod find_or_create((object)arg1, (str)arg2) object : ¶
Try to find an entity that has a matching class name. If no entity has been found, it will be created.
- Return type:
- get_datamap_property_bool((BaseEntity)arg1, (str)arg2) bool : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_char((BaseEntity)arg1, (str)arg2) str : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_color((BaseEntity)arg1, (str)arg2) _colors.Color : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_double((BaseEntity)arg1, (str)arg2) float : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_edict((BaseEntity)arg1, (str)arg2) _entities.Edict : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_float((BaseEntity)arg1, (str)arg2) float : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_int((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_interval((BaseEntity)arg1, (str)arg2) _entities._datamaps.Interval : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_long((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_long_long((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_pointer((BaseEntity)arg1, (str)arg2) object : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_quaternion((BaseEntity)arg1, (str)arg2) _mathlib.Quaternion : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_short((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_string_array((BaseEntity)arg1, (str)arg2) str : ¶
Return the value of the given data map field name.
- Return type:
bstrool
- get_datamap_property_string_pointer((BaseEntity)arg1, (str)arg2) str : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_uchar((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_uint((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_ulong((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_ulong_long((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_ushort((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given data map field name.
- Return type:
- get_datamap_property_vector((BaseEntity)arg1, (str)arg2) _mathlib.Vector : ¶
Return the value of the given data map field name.
- Return type:
- get_eye_location((BaseEntity)arg1) _mathlib.Vector : ¶
Return the entitiy’s eye location.
- Return type:
- get_key_value_bool((BaseEntity)arg1, (str)field_name) bool : ¶
Returns the value of the given field name.
- Return type:
- get_key_value_color((BaseEntity)arg1, (str)field_name) _colors.Color : ¶
Returns the value of the given field name.
- Return type:
- get_key_value_float((BaseEntity)arg1, (str)field_name) float : ¶
Returns the value of the given field name.
- Return type:
- get_key_value_int((BaseEntity)arg1, (str)field_name) int : ¶
Returns the value of the given field name.
- Return type:
- get_key_value_qangle((BaseEntity)arg1, (str)field_name) _mathlib.QAngle : ¶
Returns the value of the given field name.
- Return type:
- get_key_value_string((BaseEntity)arg1, (str)field_name) str : ¶
Returns the value of the given field name.
- Return type:
- get_key_value_vector((BaseEntity)arg1, (str)field_name) _mathlib.Vector : ¶
Returns the value of the given field name.
- Return type:
- get_network_property_bool((BaseEntity)arg1, (str)arg2) bool : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_char((BaseEntity)arg1, (str)arg2) str : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_color((BaseEntity)arg1, (str)arg2) _colors.Color : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_double((BaseEntity)arg1, (str)arg2) float : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_edict((BaseEntity)arg1, (str)arg2) _entities.Edict : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_float((BaseEntity)arg1, (str)arg2) float : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_int((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_interval((BaseEntity)arg1, (str)arg2) _entities._datamaps.Interval : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_long((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_long_long((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_pointer((BaseEntity)arg1, (str)arg2) object : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_quaternion((BaseEntity)arg1, (str)arg2) _mathlib.Quaternion : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_short((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_string_array((BaseEntity)arg1, (str)arg2) str : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_string_pointer((BaseEntity)arg1, (str)arg2) str : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_uchar((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_uint((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_ulong((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_ulong_long((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_ushort((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given server class field name.
- Return type:
- get_network_property_vector((BaseEntity)arg1, (str)arg2) _mathlib.Vector : ¶
Return the value of the given server class field name.
- Return type:
- get_output((BaseEntity)arg1, (str)arg2) _entities.BaseEntityOutput : ¶
Return the output instance matching the given name.
- Parameters:
name (str) – The name of the output.
- Return type:
- get_property_bool((BaseEntity)arg1, (str)arg2) bool : ¶
Return the value of the given field name.
- Return type:
- get_property_char((BaseEntity)arg1, (str)arg2) str : ¶
Return the value of the given field name.
- Return type:
- get_property_color((BaseEntity)arg1, (str)arg2) _colors.Color : ¶
Return the value of the given field name.
- Return type:
- get_property_double((BaseEntity)arg1, (str)arg2) float : ¶
Return the value of the given field name.
- Return type:
- get_property_edict((BaseEntity)arg1, (str)arg2) _entities.Edict : ¶
Return the value of the given field name.
- Return type:
- get_property_float((BaseEntity)arg1, (str)arg2) float : ¶
Return the value of the given field name.
- Return type:
- get_property_int((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given field name.
- Return type:
- get_property_interval((BaseEntity)arg1, (str)arg2) _entities._datamaps.Interval : ¶
Return the value of the given field name.
- Return type:
- get_property_long((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given field name.
- Return type:
- get_property_long_long((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given field name.
- Return type:
- get_property_pointer((BaseEntity)arg1, (str)arg2) object : ¶
Return the value of the given field name.
- Return type:
- get_property_quaternion((BaseEntity)arg1, (str)arg2) _mathlib.Quaternion : ¶
Return the value of the given field name.
- Return type:
- get_property_short((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given field name.
- Return type:
- get_property_string()¶
- get_property_string_array( (BaseEntity)arg1, (str)arg2) -> str :
Return the value of the given field name.
- rtype:
str
- get_property_string_array((BaseEntity)arg1, (str)arg2) str : ¶
Return the value of the given field name.
- Return type:
- get_property_string_pointer((BaseEntity)arg1, (str)arg2) str : ¶
Return the value of the given field name.
- Return type:
- get_property_uchar((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given field name.
- Return type:
- get_property_uint((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given field name.
- Return type:
- get_property_ulong((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given field name.
- Return type:
- get_property_ulong_long((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given field name.
- Return type:
- get_property_ushort((BaseEntity)arg1, (str)arg2) int : ¶
Return the value of the given field name.
- Return type:
- get_property_vector((BaseEntity)arg1, (str)arg2) _mathlib.Vector : ¶
Return the value of the given field name.
- Return type:
- is_marked_for_deletion((BaseEntity)arg1) bool : ¶
Returns whether the entity is marked for deletion.
- Return type:
- remove((BaseEntity)arg1) None : ¶
Remove the entity.
- set_datamap_property_bool((BaseEntity)arg1, (str)arg2, (bool)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_char((BaseEntity)arg1, (str)arg2, (str)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_color((BaseEntity)arg1, (str)arg2, (_colors.Color)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_double((BaseEntity)arg1, (str)arg2, (float)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_edict((BaseEntity)arg1, (str)arg2, (_entities.Edict)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_float((BaseEntity)arg1, (str)arg2, (float)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_int((BaseEntity)arg1, (str)arg2, (_engines._sound.Channel)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_interval((BaseEntity)arg1, (str)arg2, (_entities._datamaps.Interval)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_long((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_long_long((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_pointer((BaseEntity)arg1, (str)arg2, (object)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_quaternion((BaseEntity)arg1, (str)arg2, (_mathlib.Quaternion)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_short((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_string_array((BaseEntity)arg1, (str)arg2, (str)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_string_pointer((BaseEntity)arg1, (str)arg2, (str)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_uchar((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_uint((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_ulong((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_ulong_long((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_ushort((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given data map field name.
- set_datamap_property_vector((BaseEntity)arg1, (str)arg2, (_mathlib.Vector)arg3) None : ¶
Set the value of the given data map field name.
- set_key_value_bool((BaseEntity)arg1, (str)field_name, (bool)value) None : ¶
Sets a field to the given value.
- set_key_value_color((BaseEntity)arg1, (str)field_name, (_colors.Color)value) None : ¶
Sets a field to the given value.
- set_key_value_float((BaseEntity)arg1, (str)field_name, (float)value) None : ¶
Sets a field to the given value.
- set_key_value_int((BaseEntity)arg1, (str)field_name, (_engines._sound.Channel)value) None : ¶
Sets a field to the given value.
- set_key_value_qangle((BaseEntity)arg1, (str)field_name, (_mathlib.QAngle)value) None : ¶
Sets a field to the given value.
- set_key_value_string((BaseEntity)arg1, (str)field_name, (str)value) None : ¶
Sets a field to the given value.
- set_key_value_vector((BaseEntity)arg1, (str)field_name, (_mathlib.Vector)value) None : ¶
Sets a field to the given value.
- set_network_property_bool((BaseEntity)arg1, (str)arg2, (bool)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_char((BaseEntity)arg1, (str)arg2, (str)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_color((BaseEntity)arg1, (str)arg2, (_colors.Color)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_double((BaseEntity)arg1, (str)arg2, (float)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_edict((BaseEntity)arg1, (str)arg2, (_entities.Edict)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_float((BaseEntity)arg1, (str)arg2, (float)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_int((BaseEntity)arg1, (str)arg2, (_engines._sound.Channel)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_interval((BaseEntity)arg1, (str)arg2, (_entities._datamaps.Interval)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_long((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_long_long((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_pointer((BaseEntity)arg1, (str)arg2, (object)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_quaternion((BaseEntity)arg1, (str)arg2, (_mathlib.Quaternion)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_short((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_string_array((BaseEntity)arg1, (str)arg2, (str)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_string_pointer((BaseEntity)arg1, (str)arg2, (str)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_uchar((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_uint((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_ulong((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_ulong_long((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_ushort((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given server class field name.
- set_network_property_vector((BaseEntity)arg1, (str)arg2, (_mathlib.Vector)arg3) None : ¶
Set the value of the given server class field name.
- set_property_bool((BaseEntity)arg1, (str)arg2, (bool)arg3) None : ¶
Set the value of the given field name.
- set_property_char((BaseEntity)arg1, (str)arg2, (str)arg3) None : ¶
Set the value of the given field name.
- set_property_color((BaseEntity)arg1, (str)arg2, (_colors.Color)arg3) None : ¶
Set the value of the given field name.
- set_property_double((BaseEntity)arg1, (str)arg2, (float)arg3) None : ¶
Set the value of the given field name.
- set_property_edict((BaseEntity)arg1, (str)arg2, (_entities.Edict)arg3) None : ¶
Set the value of the given field name.
- set_property_float((BaseEntity)arg1, (str)arg2, (float)arg3) None : ¶
Set the value of the given field name.
- set_property_int((BaseEntity)arg1, (str)arg2, (_engines._sound.Channel)arg3) None : ¶
Set the value of the given field name.
- set_property_interval((BaseEntity)arg1, (str)arg2, (_entities._datamaps.Interval)arg3) None : ¶
Set the value of the given field name.
- set_property_long((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given field name.
- set_property_long_long((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given field name.
- set_property_pointer((BaseEntity)arg1, (str)arg2, (object)arg3) None : ¶
Set the value of the given field name.
- set_property_quaternion((BaseEntity)arg1, (str)arg2, (_mathlib.Quaternion)arg3) None : ¶
Set the value of the given field name.
- set_property_short((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given field name.
- set_property_string()¶
- set_property_string_array( (BaseEntity)arg1, (str)arg2, (str)arg3) -> None :
Set the value of the given field name.
- set_property_string_array((BaseEntity)arg1, (str)arg2, (str)arg3) None : ¶
Set the value of the given field name.
- set_property_string_pointer((BaseEntity)arg1, (str)arg2, (str)arg3) None : ¶
Set the value of the given field name.
- set_property_uchar((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given field name.
- set_property_uint((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given field name.
- set_property_ulong((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given field name.
- set_property_ulong_long((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given field name.
- set_property_ushort((BaseEntity)arg1, (str)arg2, (int)arg3) None : ¶
Set the value of the given field name.
- set_property_vector((BaseEntity)arg1, (str)arg2, (_mathlib.Vector)arg3) None : ¶
Set the value of the given field name.
- spawn((BaseEntity)arg1) None : ¶
Spawn the entity.
- stop_sound((BaseEntity)arg1, (str)sample[, (_engines._sound.Channel)channel=0]) None : ¶
Stop the given sound from being emitted by this entity.
- property collision_group¶
Get/set the entity’s collision group.
- Return type:
- factory¶
Return the entity’s factory.
- Return type:
- property gravity¶
Get/set the entity’s gravity. This is a multiplicator of
sv_gravity
. E. g. set the value to0.0
or1.0
for normal gravity.0.5
halves the gravity.- Return type:
- property ground_entity¶
Get/set the entity’s ground entity.
- Returns:
-1
if the entity has no ground entity (does not stand on an entity). The returned value is an int handle.- Return type:
- index¶
Return the index of the entity.
- Raises:
ValueError – Raised if the entity does not have an index.
- Return type:
- property owner_handle¶
Get/set the entity’s owner handle.
- Returns:
-1
if the entity has no owner entity. The returned value is an int handle.- Return type:
- property parent_inthandle¶
Get/set the entity’s parent handle.
- Returns:
-1
if the entity has no parent entity. The returned value is an int handle.- Return type:
- property physics_object¶
Return the physics object of the entity.
- Return type:
- property render_fx¶
Get/set the entity’s render effects.
- Return type:
- property render_mode¶
Get/set the entity’s render mode.
- Return type:
- server_class¶
The server class of this entity (read-only).
- Return type:
- property solid_flags¶
Get/set the entity’s solid flags.
- Return type:
- class entities.entity.Entity(index, caching=None)[source]¶
Bases:
BaseEntity
,Pointer
Class used to interact directly with entities.
Beside the standard way of doing stuff via methods and properties this class also provides dynamic attributes that depend on the entity that is being accessed with this class. You can print all dynamic properties by iterating over the following generators:
- Variables:
cache –
A read-only attribute that returns a dictionary containing the cached instances of this class.
Note
This is not an instance property, so it can only be accessed through the class itself.
caching – A read-only attribute that returns whether this class is caching its instances by default.
- classmethod from_inthandle(inthandle, caching=None)[source]¶
Create an entity instance from an inthandle.
- call_input(name, *args, **kwargs)[source]¶
Call the input function matching the given name.
- Parameters:
name (str) – Name of the input function.
args – Optional arguments that should be passed to the input function.
kwargs – Optional keyword arguments that should be passed to the input function.
- Raises:
ValueError – Raised if the input function wasn’t found.
- delay(delay, callback, args=(), kwargs=None, cancel_on_level_end=False)[source]¶
Create the delay which will be stopped after removing the entity.
- Parameters:
delay (float) – The delay in seconds.
callback – A callable object that should be called after the delay expired.
args (tuple) – Arguments that should be passed to the callback.
kwargs (dict) – Keyword arguments that should be passed to the callback.
cancel_on_level_end (bool) – Whether or not to cancel the delay at the end of the map.
- Raises:
ValueError – If the given callback is not callable.
- Returns:
The delay instance.
- Return type:
- emit_sound(sample, recipients=(), volume=1.0, attenuation=Attenuation.NONE, channel=_engines._sound.Channel.AUTO, flags=_engines._sound.SoundFlags.NO_FLAGS, pitch=_engines._sound.Pitch.NORMAL, origin=Vector(0.0, 0.0, 0.0), direction=Vector(0.0, 0.0, 0.0), origins=(), update_positions=True, sound_time=0.0, speaker_entity=-1, download=False, stream=False)[source]¶
Emit a sound from this entity.
- Parameters:
sample (str) – Sound file relative to the
sounds
directory.recipients (RecipientFilter) – Recipients to emit the sound to.
index (int) – Index of the entity to emit the sound from.
volume (float) – Volume of the sound.
attenuation (Attenuation) – How far the sound should reaches.
channel (int) – Channel to emit the sound with.
flags (SoundFlags) – Flags of the sound.
pitch (Pitch) – Pitch of the sound.
origin (Vector) – Origin of the sound.
direction (Vector) – Direction of the sound.
origins (tuple) – Origins of the sound.
update_positions (bool) – Whether or not the positions should be updated.
sound_time (float) – Time to play the sound for.
speaker_entity (int) – Index of the speaker entity.
download (bool) – Whether or not the sample should be added to the downloadables.
stream (bool) – Whether or not the sound should be streamed.
- get_input(name)[source]¶
Return the input function matching the given name.
- Parma str name:
Name of the input function.
- Return type:
- Raises:
KeyError – Raised if the input function wasn’t found.
- get_model()[source]¶
Return the entity’s model.
- Returns:
None
if the entity has no model.- Return type:
- get_output(name)[source]¶
Return the output instance matching the given name.
- Parma str name:
Name of the output.
- Return type:
- Raises:
KeyError – Raised if the output instance wasn’t found.
- is_in_solid(mask=<ContentMasks.ALL: 4294967295>, generator=None)[source]¶
Return whether or not the entity is in solid.
- Parameters:
mask (ContentMasks) – Contents the ray can possibly collide with.
generator – A callable that returns an iterable which contains
BaseEntity
instances that are ignored by the ray.
- Return type:
- repeat(callback, args=(), kwargs=None, cancel_on_level_end=False)[source]¶
Create the repeat which will be stopped after removing the entity. :param callback:
A callable object that should be called at the end of each loop.
- Parameters:
- Raises:
ValueError – Raised if the given callback is not callable.
- Returns:
The repeat instance.
- Return type:
- take_damage(damage, damage_type=<DamageTypes.GENERIC: 0>, attacker_index=None, weapon_index=None, hitgroup=HitGroup.GENERIC, skip_hooks=False, **kwargs)[source]¶
Deal damage to the entity.
- Parameters:
damage (int) – Amount of damage to deal.
damage_type (DamageTypes) – Type of the dealed damage.
attacker_index (int) – If not None, the index will be used as the attacker.
weapon_index (int) – If not None, the index will be used as the weapon. This method also tries to retrieve the attacker from the weapon, if
attacker_index
wasn’t set.hitgroup (HitGroup) – The hitgroup where the damage should be applied.
skip_hooks (bool) – If True, the damage will be dealed directly by skipping any registered hooks.
- dynamic_attributes¶
- inputs¶
- keyvalues¶
- property model¶
Property to get/set the entity’s model.
See also
- outputs¶
- property owner¶
Return the entity’s owner.
- Returns:
None if the entity has no owner.
- Return type:
- property parent¶
Property to get/set the parent of the entity.
See also
- properties¶
- server_classes¶
- set_model¶
Set the entity’s model to the given model.
- Parameters:
model (str/Model) – The model path or model to set.
- set_parent¶
Set the parent of the entity.