Sim Event Types¶
Age Changed¶
-
class
S4CLSimChangedAgeEvent
(sim_info, old_age, new_age)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim has changed their current Age.
Note
This can occur when a Child Sim becomes a Teen Sim, a Teen Sim becomes a Child Sim, etc.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimChangedAgeEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- old_age (CommonAge) – The age the Sim has changed from.
- new_age (CommonAge) – The age the Sim has changed to.
-
new_age
¶ The age the Sim has changed to.
-
old_age
¶ The age the Sim has changed from.
-
sim_info
¶ The Sim that changed.
Buff Added¶
-
class
S4CLSimBuffAddedEvent
(sim_info, buff)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Buff is added to a Sim.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity()) def handle_event(event_data: S4CLSimBuffAddedEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- buff (Buff) – The Buff that was added.
-
buff
¶ The Buff that was added.
Returns: The Buff that was added. Return type: Buff
-
buff_id
¶ The decimal identifier of the Buff.
Returns: The decimal identifier of the Buff. Return type: int
-
sim_info
¶ The Sim that received the buff.
Returns: The Sim that received the buff. Return type: SimInfo
Buff Removed¶
-
class
S4CLSimBuffRemovedEvent
(sim_info, buff)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Buff is removed from a Sim.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity()) def handle_event(event_data: S4CLSimBuffRemovedEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- buff (Buff) – The Buff that was removed.
-
buff
¶ The Buff that was removed.
Returns: The Buff that was removed. Return type: Buff
-
buff_id
¶ The decimal identifier of the Buff.
Returns: The decimal identifier of the Buff. Return type: int
-
sim_info
¶ The Sim that lost the buff.
Returns: The Sim that lost the buff. Return type: SimInfo
Game Object Added To Sim Inventory¶
-
class
S4CLGameObjectAddedToSimInventoryEvent
(sim_info, added_game_object)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Game Object is added to the inventory of a Sim.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity()) def handle_event(event_data: S4CLGameObjectAddedToSimInventoryEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- added_game_object (GameObject) – The Game Object that was added to the inventory of the Sim.
-
added_game_object
¶ The Game Object that was added.
Returns: The Game Object that was added. Return type: GameObject
-
added_game_object_id
¶ The decimal identifier of the Game Object that was added.
Returns: The decimal identifier of the Game Object that was added. Return type: int
-
added_object_guid
¶ The guid identifier of the Game Object that was added.
Returns: The guid identifier of the Game Object that was added. Return type: int
-
sim_info
¶ The Sim that received the added object.
Returns: The Sim that received the added object. Return type: SimInfo
Game Object Pre Removed From Sim Inventory¶
-
class
S4CLGameObjectPreRemovedFromSimInventoryEvent
(sim_info, removed_game_object)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs before a Game Object is removed from the inventory of a Sim.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity()) def handle_event(event_data: S4CLGameObjectPreRemovedFromSimInventoryEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- removed_game_object (GameObject) – The Game Object that was removed from the inventory of the Sim.
-
removed_game_object
¶ The Game Object that is being removed.
Returns: The Game Object that is being removed. Return type: GameObject
-
removed_game_object_guid
¶ The guid identifier of the Game Object that was removed.
Returns: The guid identifier of the Game Object that was removed. Return type: int
-
removed_game_object_id
¶ The decimal identifier of the Game Object that was removed.
Returns: The decimal identifier of the Game Object that was removed. Return type: int
-
sim_info
¶ The Sim that is having the object removed.
Returns: The Sim that is having the object removed. Return type: SimInfo
Occult Added¶
-
class
S4CLSimAddedOccultTypeEvent
(sim_info, occult_type, occult_tracker)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when an OccultType has been added to a Sim.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimAddedOccultTypeEvent): pass
Parameters: - sim_info (SimInfo) – The Sim the Occult Type was added to.
- occult_type (OccultType) – The OccultType that was added.
- occult_tracker (OccultTracker) – A tracker that keeps track of the occult status of the Sim.
-
occult_tracker
¶ A tracker that keeps track of the occult status of the Sim.
Returns: A tracker that keeps track of the occult status of the Sim. Return type: OccultTracker
-
occult_type
¶ The OccultType that was added.
Returns: The OccultType that was added. Return type: OccultType
-
sim_info
¶ The Sim the OccultType was added to.
Returns: The Sim the OccultType was added to. Return type: SimInfo
Occult Changed¶
-
class
S4CLSimChangedOccultTypeEvent
(sim_info, occult_type, occult_tracker)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim has changed their current OccultType.
Note
This can occur when an Alien Sim changes between their Disguised form and their True form.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimChangedOccultTypeEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed OccultTypes.
- occult_type (OccultType) – The OccultType the Sim has changed to.
- occult_tracker (OccultTracker) – A tracker that keeps track of the occult status of the Sim.
-
occult_tracker
¶ A tracker that keeps track of the occult status of the Sim.
Returns: A tracker that keeps track of the occult status of the Sim. Return type: OccultTracker
-
occult_type
¶ The OccultType the Sim has changed to.
Returns: The OccultType the Sim has changed to. Return type: OccultType
-
sim_info
¶ The Sim that changed OccultTypes.
Returns: The Sim that changed OccultTypes. Return type: SimInfo
Occult Changing¶
-
class
S4CLSimChangingOccultTypeEvent
(sim_info, occult_type, occult_tracker)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim is changing their current OccultType. (But before they have changed!)
Note
This can occur when an Alien Sim changes between their Disguised form and their True form or when a Mermaid changes from their Non-Mermaid form to their Mermaid form.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimChangingOccultTypeEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changing OccultTypes.
- occult_type (OccultType) – The OccultType the Sim is changing to.
- occult_tracker (OccultTracker) – A tracker that keeps track of the occult status of the Sim.
-
occult_tracker
¶ A tracker that keeps track of the occult status of the Sim.
Returns: A tracker that keeps track of the occult status of the Sim. Return type: OccultTracker
-
occult_type
¶ The OccultType the Sim is changing to.
Returns: The OccultType the Sim is changing to. Return type: OccultType
-
sim_info
¶ The Sim that changed OccultTypes.
Returns: The Sim that changed OccultTypes. Return type: SimInfo
Occult Removed¶
-
class
S4CLSimRemovedOccultTypeEvent
(sim_info, occult_type, occult_tracker)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when an OccultType has been removed from a Sim.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimRemovedOccultTypeEvent): pass
Parameters: - sim_info (SimInfo) – The Sim the Occult Type was removed from.
- occult_type (OccultType) – The OccultType that was removed.
- occult_tracker (OccultTracker) – A tracker that keeps track of the occult status of the Sim.
-
occult_tracker
¶ A tracker that keeps track of the occult status of the Sim.
Returns: A tracker that keeps track of the occult status of the Sim. Return type: OccultTracker
-
occult_type
¶ The OccultType that was removed.
Returns: The OccultType that was removed. Return type: OccultType
-
sim_info
¶ The Sim the OccultType was removed from.
Returns: The Sim the OccultType was removed from. Return type: SimInfo
Outfit Changing¶
-
class
S4CLSimSetCurrentOutfitEvent
(sim_info, old_outfit_category_and_index, new_outfit_category_and_index)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when the current outfit of a Sim is being set. (Before it is actually set)
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimSetCurrentOutfitEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- old_outfit_category_and_index (Tuple[OutfitCategory, int]) – The outfit category and index for the outfit the Sim is changing from.
- new_outfit_category_and_index (Tuple[OutfitCategory, int]) – The outfit category and index for the outfit the Sim is changing to.
-
new_outfit_category_and_index
¶ The outfit category and index for the outfit the Sim is changing to.
-
old_outfit_category_and_index
¶ The outfit category and index for the outfit the Sim is changing from.
-
sim_info
¶ The Sim that is changing.
Outfit Changed¶
-
class
S4CLSimAfterSetCurrentOutfitEvent
(sim_info, old_outfit_category_and_index, new_outfit_category_and_index)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs after the current outfit of a Sim is set.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimAfterSetCurrentOutfitEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- old_outfit_category_and_index (Tuple[OutfitCategory, int]) – The outfit category and index for the outfit the Sim has changed from.
- new_outfit_category_and_index (Tuple[OutfitCategory, int]) – The outfit category and index for the outfit the Sim has changed to.
-
new_outfit_category_and_index
¶ The outfit category and index for the outfit the Sim has changed to.
-
old_outfit_category_and_index
¶ The outfit category and index for the outfit the Sim has changed from.
-
sim_info
¶ The Sim that changed.
Sim Initialized¶
-
class
S4CLSimInitializedEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs after a Sim has been initialized.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimInitializedEvent): pass
Parameters: sim_info (SimInfo) – The Sim that was initialized. -
sim_info
¶ The Sim that was initialized.
Returns: The Sim that was initialized. Return type: SimInfo
-
Sim Loaded¶
-
class
S4CLSimLoadedEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs after a Sim has been loaded.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimLoadedEvent): pass
Parameters: sim_info (SimInfo) – The Sim that was loaded. -
sim_info
¶ The Sim that was loaded.
Returns: The Sim that was loaded. Return type: SimInfo
-
Sim Spawned¶
-
class
S4CLSimSpawnedEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs after a Sim has been spawned.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimSpawnedEvent): pass
Parameters: sim_info (SimInfo) – The Sim that was spawned. -
sim_info
¶ The Sim that was spawned.
Returns: The Sim that was spawned. Return type: SimInfo
-
Pre Sim Despawned¶
-
class
S4CLSimPreDespawnedEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim is being despawned.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimPreDespawnedEvent): pass
Parameters: sim_info (SimInfo) – The Sim that is being despawned. -
sim_info
¶ The Sim that is being despawned.
Returns: The Sim that is being despawned. Return type: SimInfo
-
Sim Died¶
-
class
S4CLSimDiedEvent
(sim_info, death_type, died_off_lot)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim has died.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimDiedEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that died.
- death_type (CommonDeathType) – The type of Death that befell the Sim.
- died_off_lot (bool) – True, if the Sim died off the active lot. False, if not.
-
death_type
¶ The type of Death that befell the Sim.
-
died_off_lot
¶ True, if the Sim died off the active lot. False, if not.
-
sim_info
¶ The Sim that died.
Returns: The Sim that died. Return type: SimInfo
`Sim Revived¶
-
class
S4CLSimRevivedEvent
(sim_info, previous_death_type)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim has been revived after having previously been dead.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimRevivedEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that was revived.
- previous_death_type (CommonDeathType) – The type of Death that befell the Sim before they were revived.
-
previous_death_type
¶ The type of Death that befell the Sim before they were revived.
-
sim_info
¶ The Sim that was revived.
Skill Leveled Up¶
-
class
S4CLSimSkillLeveledUpEvent
(sim_info, skill, old_skill_level, new_skill_level)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim levels up in a Skill.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity()) def handle_event(event_data: S4CLSimSkillLeveledUpEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- skill (Skill) – The Skill that was leveled up.
- old_skill_level (int) – The level the Sim was at before leveling up.
- new_skill_level (int) – The level the Sim will be after leveling up.
-
new_skill_level
¶ The level the Sim will be after leveling up.
-
old_skill_level
¶ The level the Sim was at before leveling up.
-
sim_info
¶ The Sim that leveled up in a Skill.
-
skill
¶ The Skill that was leveled up.
-
skill_id
¶ The decimal identifier of the Skill.
Trait Added¶
-
class
S4CLSimTraitAddedEvent
(sim_info, trait, trait_tracker)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Trait is added to a Sim.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity()) def handle_event(event_data: S4CLSimTraitAddedEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- trait (Trait) – The Trait that was added.
- trait_tracker (TraitTracker) – The Trait Tracker being added to.
-
sim_info
¶ The Sim that received the trait.
Returns: The Sim that received the trait. Return type: SimInfo
-
trait
¶ The Trait that was added.
Returns: The Trait that was added. Return type: Trait
-
trait_id
¶ The decimal identifier of the Trait.
Returns: The decimal identifier of the Trait. Return type: int
-
trait_tracker
¶ The Trait Tracker being added to.
Returns: The Trait Tracker being added to. Return type: TraitTracker
Trait Removed¶
-
class
S4CLSimTraitRemovedEvent
(sim_info, trait, trait_tracker)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Trait is removed from a Sim.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity()) def handle_event(event_data: S4CLSimTraitRemovedEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- trait (Trait) – The Trait that was removed.
- trait_tracker (TraitTracker) – The Trait Tracker being removed from.
-
sim_info
¶ The Sim that lost the trait.
Returns: The Sim that lost the trait. Return type: SimInfo
-
trait
¶ The Trait that was removed.
Returns: The Trait that was removed. Return type: Trait
-
trait_id
¶ The decimal identifier of the Trait.
Returns: The decimal identifier of the Trait. Return type: int
-
trait_tracker
¶ The Trait Tracker being removed from.
Returns: The Trait Tracker being removed from. Return type: TraitTracker
Gender Options¶
Sim Changed Gender¶
-
class
S4CLSimChangedGenderEvent
(sim_info, old_gender, new_gender)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim has changed their current gender.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimChangedGenderEvent): pass
Parameters: - sim_info (SimInfo) – The Sim that changed.
- old_gender (CommonGender) – The gender the Sim has changed from.
- new_gender (CommonGender) – The gender the Sim has changed to.
-
new_gender
¶ The gender the Sim has changed to.
-
old_gender
¶ The gender the Sim has changed from.
-
sim_info
¶ The Sim that changed.
Sim Changed Body Frame¶
-
class
S4CLSimChangedGenderOptionsBodyFrameEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim has changed their body frame. i.e. Masculine to Feminine or vice verse
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity()) def handle_event(event_data: S4CLSimChangedGenderOptionsBodyFrameEvent): pass
Parameters: sim_info (SimInfo) – The Sim that changed. -
sim_info
¶ The Sim that changed.
Returns: The Sim that changed. Return type: SimInfo
-
Sim Changed Breasts¶
-
class
S4CLSimChangedGenderOptionsBreastsEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim has changed whether or not they have breasts.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity()) def handle_event(event_data: S4CLSimChangedGenderOptionsBreastsEvent): pass
Parameters: sim_info (SimInfo) – The Sim that changed. -
sim_info
¶ The Sim that changed.
Returns: The Sim that changed. Return type: SimInfo
-
Sim Changed Can Be Impregnated¶
-
class
S4CLSimChangedGenderOptionsCanBeImpregnatedEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Human Sim has changed whether they can be impregnated by other Sims or not.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimChangedGenderOptionsCanBeImpregnatedEvent): pass
Parameters: sim_info (SimInfo) – The Sim that changed. -
sim_info
¶ The Sim that changed.
Returns: The Sim that changed. Return type: SimInfo
-
Sim Changed Can Impregnate¶
-
class
S4CLSimChangedGenderOptionsCanImpregnateEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Human Sim has changed whether they can impregnate other Sims or not.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimChangedGenderOptionsCanImpregnateEvent): pass
Parameters: sim_info (SimInfo) – The Sim that changed. -
sim_info
¶ The Sim that changed.
Returns: The Sim that changed. Return type: SimInfo
-
Sim Changed Can Reproduce¶
-
class
S4CLSimChangedGenderOptionsCanReproduceEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Pet Sim has changed whether they can reproduce or not.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimChangedGenderOptionsCanReproduceEvent): pass
Parameters: sim_info (SimInfo) – The Sim that changed. -
sim_info
¶ The Sim that changed.
Returns: The Sim that changed. Return type: SimInfo
-
Sim Changed Clothing Preference¶
-
class
S4CLSimChangedGenderOptionsClothingPreferenceEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim has changed their clothing preference. i.e. Menswear to Womenswear or vice verse
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimChangedGenderOptionsClothingPreferenceEvent): pass
Parameters: sim_info (SimInfo) – The Sim that changed. -
sim_info
¶ The Sim that changed.
Returns: The Sim that changed. Return type: SimInfo
-
Sim Changed Toilet Usage¶
-
class
S4CLSimChangedGenderOptionsToiletUsageEvent
(sim_info)¶ Bases:
sims4communitylib.events.event_handling.common_event.CommonEvent
An event that occurs when a Sim has changed the way they use the toilet. i.e. Toilet Standing to Toilet Sitting or Toilet Sitting to Toilet Standing.
Example usage: from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLSimChangedGenderOptionsToiletUsageEvent): pass
Parameters: sim_info (SimInfo) – The Sim that changed. -
sim_info
¶ The Sim that changed.
Returns: The Sim that changed. Return type: SimInfo
-