entities.entity module¶
Provides a class used to interact with a specific entity.
-
class
entities.entity.
BaseEntity
¶ Bases:
_entities.ServerEntity
-
__init__
((object)arg1, (int)entity_index) → object¶
-
classmethod
create
((object)arg1, (str)arg2) → object :¶ Create an entity by its class name.
Return type: BaseEntity
-
classmethod
find
((object)arg1, (str)arg2) → object :¶ Return the first entity that has a matching class name.
Return type: BaseEntity
-
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: BaseEntity
-
get_datamap_property_bool
((BaseEntity)arg1, (str)arg2) → bool :¶ Return the value of the given data map field name.
Return type: bool
-
get_datamap_property_char
((BaseEntity)arg1, (str)arg2) → str :¶ Return the value of the given data map field name.
Return type: str
-
get_datamap_property_color
((BaseEntity)arg1, (str)arg2) → Color :¶ Return the value of the given data map field name.
Return type: Color
-
get_datamap_property_double
((BaseEntity)arg1, (str)arg2) → float :¶ Return the value of the given data map field name.
Return type: float
-
get_datamap_property_edict
((BaseEntity)arg1, (str)arg2) → Edict :¶ Return the value of the given data map field name.
Return type: Edict
-
get_datamap_property_float
((BaseEntity)arg1, (str)arg2) → float :¶ Return the value of the given data map field name.
Return type: float
-
get_datamap_property_int
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given data map field name.
Return type: int
-
get_datamap_property_interval
((BaseEntity)arg1, (str)arg2) → Interval :¶ Return the value of the given data map field name.
Return type: Interval
-
get_datamap_property_long
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given data map field name.
Return type: int
-
get_datamap_property_long_long
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given data map field name.
Return type: int
-
get_datamap_property_pointer
((BaseEntity)arg1, (str)arg2) → object :¶ Return the value of the given data map field name.
Return type: Pointer
-
get_datamap_property_quaternion
((BaseEntity)arg1, (str)arg2) → Quaternion :¶ Return the value of the given data map field name.
Return type: Quaternion
-
get_datamap_property_short
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given data map field name.
Return type: int
-
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: str
-
get_datamap_property_uchar
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given data map field name.
Return type: int
-
get_datamap_property_uint
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given data map field name.
Return type: int
-
get_datamap_property_ulong
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given data map field name.
Return type: int
-
get_datamap_property_ulong_long
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given data map field name.
Return type: int
-
get_datamap_property_ushort
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given data map field name.
Return type: int
-
get_datamap_property_vector
((BaseEntity)arg1, (str)arg2) → Vector :¶ Return the value of the given data map field name.
Return type: Vector
-
get_eye_location
((BaseEntity)arg1) → Vector :¶ Return the entitiy’s eye location.
Return type: Vector
-
get_key_value_bool
((BaseEntity)arg1, (str)field_name) → bool :¶ Returns the value of the given field name.
Return type: bool
-
get_key_value_color
((BaseEntity)arg1, (str)field_name) → Color :¶ Returns the value of the given field name.
Return type: Color
-
get_key_value_float
((BaseEntity)arg1, (str)field_name) → float :¶ Returns the value of the given field name.
Return type: float
-
get_key_value_int
((BaseEntity)arg1, (str)field_name) → int :¶ Returns the value of the given field name.
Return type: int
-
get_key_value_qangle
((BaseEntity)arg1, (str)field_name) → QAngle :¶ Returns the value of the given field name.
Return type: QAngle
-
get_key_value_string
((BaseEntity)arg1, (str)field_name) → str :¶ Returns the value of the given field name.
Return type: str
-
get_key_value_vector
((BaseEntity)arg1, (str)field_name) → Vector :¶ Returns the value of the given field name.
Return type: Vector
-
get_network_property_bool
((BaseEntity)arg1, (str)arg2) → bool :¶ Return the value of the given server class field name.
Return type: bool
-
get_network_property_char
((BaseEntity)arg1, (str)arg2) → str :¶ Return the value of the given server class field name.
Return type: str
-
get_network_property_color
((BaseEntity)arg1, (str)arg2) → Color :¶ Return the value of the given server class field name.
Return type: Color
-
get_network_property_double
((BaseEntity)arg1, (str)arg2) → float :¶ Return the value of the given server class field name.
Return type: float
-
get_network_property_edict
((BaseEntity)arg1, (str)arg2) → Edict :¶ Return the value of the given server class field name.
Return type: Edict
-
get_network_property_float
((BaseEntity)arg1, (str)arg2) → float :¶ Return the value of the given server class field name.
Return type: float
-
get_network_property_int
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given server class field name.
Return type: int
-
get_network_property_interval
((BaseEntity)arg1, (str)arg2) → Interval :¶ Return the value of the given server class field name.
Return type: Interval
-
get_network_property_long
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given server class field name.
Return type: int
-
get_network_property_long_long
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given server class field name.
Return type: int
-
get_network_property_pointer
((BaseEntity)arg1, (str)arg2) → object :¶ Return the value of the given server class field name.
Return type: Pointer
-
get_network_property_quaternion
((BaseEntity)arg1, (str)arg2) → Quaternion :¶ Return the value of the given server class field name.
Return type: Quaternion
-
get_network_property_short
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given server class field name.
Return type: int
-
get_network_property_string_array
((BaseEntity)arg1, (str)arg2) → str :¶ Return the value of the given server class field name.
Return type: str
-
get_network_property_string_pointer
((BaseEntity)arg1, (str)arg2) → str :¶ Return the value of the given server class field name.
Return type: str
-
get_network_property_uchar
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given server class field name.
Return type: int
-
get_network_property_uint
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given server class field name.
Return type: int
-
get_network_property_ulong
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given server class field name.
Return type: int
-
get_network_property_ulong_long
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given server class field name.
Return type: int
-
get_network_property_ushort
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given server class field name.
Return type: int
-
get_network_property_vector
((BaseEntity)arg1, (str)arg2) → Vector :¶ Return the value of the given server class field name.
Return type: Vector
-
get_output
((BaseEntity)arg1, (str)arg2) → BaseEntityOutput :¶ Return the output instance matching the given name.
Parameters: name (str) – The name of the output. Return type: BaseEntityOutput
-
get_property_bool
((BaseEntity)arg1, (str)arg2) → bool :¶ Return the value of the given field name.
Return type: bool
-
get_property_char
((BaseEntity)arg1, (str)arg2) → str :¶ Return the value of the given field name.
Return type: str
-
get_property_color
((BaseEntity)arg1, (str)arg2) → Color :¶ Return the value of the given field name.
Return type: Color
-
get_property_double
((BaseEntity)arg1, (str)arg2) → float :¶ Return the value of the given field name.
Return type: float
-
get_property_edict
((BaseEntity)arg1, (str)arg2) → Edict :¶ Return the value of the given field name.
Return type: Edict
-
get_property_float
((BaseEntity)arg1, (str)arg2) → float :¶ Return the value of the given field name.
Return type: float
-
get_property_int
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given field name.
Return type: int
-
get_property_interval
((BaseEntity)arg1, (str)arg2) → Interval :¶ Return the value of the given field name.
Return type: Interval
-
get_property_long
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given field name.
Return type: int
-
get_property_long_long
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given field name.
Return type: int
-
get_property_pointer
((BaseEntity)arg1, (str)arg2) → object :¶ Return the value of the given field name.
Return type: Pointer
-
get_property_quaternion
((BaseEntity)arg1, (str)arg2) → Quaternion :¶ Return the value of the given field name.
Return type: Quaternion
-
get_property_short
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given field name.
Return type: int
-
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: str
-
get_property_string_pointer
((BaseEntity)arg1, (str)arg2) → str :¶ Return the value of the given field name.
Return type: str
-
get_property_uchar
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given field name.
Return type: int
-
get_property_uint
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given field name.
Return type: int
-
get_property_ulong
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given field name.
Return type: int
-
get_property_ulong_long
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given field name.
Return type: int
-
get_property_ushort
((BaseEntity)arg1, (str)arg2) → int :¶ Return the value of the given field name.
Return type: int
-
get_property_vector
((BaseEntity)arg1, (str)arg2) → Vector :¶ Return the value of the given field name.
Return type: Vector
-
is_marked_for_deletion
((BaseEntity)arg1) → bool :¶ Returns whether the entity is marked for deletion.
Return type: bool
-
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, (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, (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, (Channel)arg3) → None :¶ Set the value of the given data map field name.
-
set_datamap_property_interval
((BaseEntity)arg1, (str)arg2, (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, (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, (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, (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, (Channel)value) → None :¶ Sets a field to the given value.
-
set_key_value_qangle
((BaseEntity)arg1, (str)field_name, (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, (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, (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, (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, (Channel)arg3) → None :¶ Set the value of the given server class field name.
-
set_network_property_interval
((BaseEntity)arg1, (str)arg2, (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, (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, (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, (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, (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, (Channel)arg3) → None :¶ Set the value of the given field name.
-
set_property_interval
((BaseEntity)arg1, (str)arg2, (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, (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, (Vector)arg3) → None :¶ Set the value of the given field name.
-
spawn
((BaseEntity)arg1) → None :¶ Spawn the entity.
-
stop_sound
((BaseEntity)arg1, (str)sample[, (Channel)channel=0]) → None :¶ Stop the given sound from being emitted by this entity.
Parameters:
-
collision_group
¶ Get/set the entity’s collision group.
Return type: CollisionGroup
-
factory
¶ Return the entity’s factory.
Return type: EntityFactory
-
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: float
-
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: int
-
index
¶ Return the index of the entity.
Raises: ValueError – Raised if the entity does not have an index. Return type: int
-
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: int
-
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: int
-
physics_object
¶ Return the physics object of the entity.
Return type: PhysicsObject
-
render_fx
¶ Get/set the entity’s render effects.
Return type: RenderEffects
-
render_mode
¶ Get/set the entity’s render mode.
Return type: RenderMode
-
server_class
¶ The server class of this entity (read-only).
Return type: ServerClass
-
solid_flags
¶ Get/set the entity’s solid flags.
Return type: SolidFlags
-
-
class
entities.entity.
Entity
(index, caching=True)[source]¶ Bases:
_entities._entity.BaseEntity
,_memory.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: -
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: 0.0>, 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.
- sample (str) – Sound file relative to the
-
classmethod
from_inthandle
(inthandle, caching=None)[source]¶ Create an entity instance from an inthandle.
Parameters: Return type:
-
get_input
(name)[source]¶ Return the input function matching the given name.
Parma str name: Name of the input function. Return type: InputFunction 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: Model
-
get_output
(name)[source]¶ Return the output instance matching the given name.
Parma str name: Name of the output. Return type: BaseEntityOutput 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: 0>, 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
¶
-
model
¶ Property to get/set the entity’s model.
See also
-
outputs
¶
-
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.
Parameters:
-