Sim Event Types

Age Changing

class S4CLSimChangingAgeEvent(sim_info, old_age, new_age)

Bases: CommonEvent

An event that occurs when a Sim is changing their current Age, before they have changed ages.

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: S4CLSimChangingAgeEvent):
        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.

property new_age

The age the Sim has changed to.

property old_age

The age the Sim has changed from.

property sim_info

The Sim that changed.

Age Changed

class S4CLSimChangedAgeEvent(sim_info, old_age, new_age)

Bases: 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.

property new_age

The age the Sim has changed to.

property old_age

The age the Sim has changed from.

property sim_info

The Sim that changed.

Buff Added

class S4CLSimBuffAddedEvent(sim_info, buff)

Bases: 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.

property buff

The Buff that was added.

Returns:

The Buff that was added.

Return type:

Buff

property buff_id

The decimal identifier of the Buff.

Returns:

The decimal identifier of the Buff.

Return type:

int

property 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: 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.

property buff

The Buff that was removed.

Returns:

The Buff that was removed.

Return type:

Buff

property buff_id

The decimal identifier of the Buff.

Returns:

The decimal identifier of the Buff.

Return type:

int

property 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: 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.

property added_game_object

The Game Object that was added.

Returns:

The Game Object that was added.

Return type:

GameObject

property 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

property 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

property 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: 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.

property removed_game_object

The Game Object that is being removed.

Returns:

The Game Object that is being removed.

Return type:

GameObject

property 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

property 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

property 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: 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.

property 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

property occult_type

The OccultType that was added.

Returns:

The OccultType that was added.

Return type:

OccultType

property 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: 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.

property 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

property occult_type

The OccultType the Sim has changed to.

Returns:

The OccultType the Sim has changed to.

Return type:

OccultType

property 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: 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.

property 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

property occult_type

The OccultType the Sim is changing to.

Returns:

The OccultType the Sim is changing to.

Return type:

OccultType

property 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: 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.

property 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

property occult_type

The OccultType that was removed.

Returns:

The OccultType that was removed.

Return type:

OccultType

property 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: 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.

property new_outfit_category_and_index

The outfit category and index for the outfit the Sim is changing to.

property old_outfit_category_and_index

The outfit category and index for the outfit the Sim is changing from.

property sim_info

The Sim that is changing.

Outfit Changed

class S4CLSimAfterSetCurrentOutfitEvent(sim_info, old_outfit_category_and_index, new_outfit_category_and_index)

Bases: 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.

property new_outfit_category_and_index

The outfit category and index for the outfit the Sim has changed to.

property old_outfit_category_and_index

The outfit category and index for the outfit the Sim has changed from.

property sim_info

The Sim that changed.

Pregnancy Ended

class S4CLSimPregnancyEndedEvent(sim_info)

Bases: CommonEvent

An event that occurs after a pregnancy has ended for 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: S4CLSimPregnancyEndedEvent):
        pass
Parameters:

sim_info (SimInfo) – The info of a Sim that had a pregnancy ended.

property sim_info

The info of the Sim that had a pregnancy ended.

Returns:

The info of the Sim that had a pregnancy ended.

Return type:

SimInfo

Pregnancy Started

class S4CLSimPregnancyStartedEvent(sim_info)

Bases: CommonEvent

An event that occurs after a pregnancy is started for 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: S4CLSimPregnancyStartedEvent):
        pass
Parameters:

sim_info (SimInfo) – The info of a Sim that had a pregnancy started.

property sim_info

The info of the Sim that started pregnancy.

Returns:

The info of the Sim that started pregnancy.

Return type:

SimInfo

Sim Initialized

class S4CLSimInitializedEvent(sim_info)

Bases: 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.

property sim_info

The Sim that was initialized.

Returns:

The Sim that was initialized.

Return type:

SimInfo

Sim Loaded

class S4CLSimLoadedEvent(sim_info)

Bases: 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.

property sim_info

The Sim that was loaded.

Returns:

The Sim that was loaded.

Return type:

SimInfo

Sim Spawned

class S4CLSimSpawnedEvent(sim_info)

Bases: 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.

property sim_info

The Sim that was spawned.

Returns:

The Sim that was spawned.

Return type:

SimInfo

Pre Sim Despawned

class S4CLSimPreDespawnedEvent(sim_info)

Bases: 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.

property 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: 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.

property death_type

The type of Death that befell the Sim.

property died_off_lot

True, if the Sim died off the active lot. False, if not.

property sim_info

The Sim that died.

Returns:

The Sim that died.

Return type:

SimInfo

`Sim Revived

class S4CLSimRevivedEvent(sim_info, previous_death_type)

Bases: 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.

property previous_death_type

The type of Death that befell the Sim before they were revived.

property sim_info

The Sim that was revived.

Skill Leveled Up

Trait Added

class S4CLSimTraitAddedEvent(sim_info, trait, trait_tracker)

Bases: 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.

property sim_info

The Sim that received the trait.

Returns:

The Sim that received the trait.

Return type:

SimInfo

property trait

The Trait that was added.

Returns:

The Trait that was added.

Return type:

Trait

property trait_id

The decimal identifier of the Trait.

Returns:

The decimal identifier of the Trait.

Return type:

int

property 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: 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.

property sim_info

The Sim that lost the trait.

Returns:

The Sim that lost the trait.

Return type:

SimInfo

property trait

The Trait that was removed.

Returns:

The Trait that was removed.

Return type:

Trait

property trait_id

The decimal identifier of the Trait.

Returns:

The decimal identifier of the Trait.

Return type:

int

property 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: 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.

property new_gender

The gender the Sim has changed to.

property old_gender

The gender the Sim has changed from.

property sim_info

The Sim that changed.

Sim Changed Body Frame

class S4CLSimChangedGenderOptionsBodyFrameEvent(sim_info)

Bases: 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.

property sim_info

The Sim that changed.

Returns:

The Sim that changed.

Return type:

SimInfo

Sim Changed Breasts

class S4CLSimChangedGenderOptionsBreastsEvent(sim_info)

Bases: 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.

property sim_info

The Sim that changed.

Returns:

The Sim that changed.

Return type:

SimInfo

Sim Changed Can Be Impregnated

class S4CLSimChangedGenderOptionsCanBeImpregnatedEvent(sim_info)

Bases: 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.

property sim_info

The Sim that changed.

Returns:

The Sim that changed.

Return type:

SimInfo

Sim Changed Can Impregnate

class S4CLSimChangedGenderOptionsCanImpregnateEvent(sim_info)

Bases: 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.

property sim_info

The Sim that changed.

Returns:

The Sim that changed.

Return type:

SimInfo

Sim Changed Can Reproduce

class S4CLSimChangedGenderOptionsCanReproduceEvent(sim_info)

Bases: 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.

property sim_info

The Sim that changed.

Returns:

The Sim that changed.

Return type:

SimInfo

Sim Changed Clothing Preference

class S4CLSimChangedGenderOptionsClothingPreferenceEvent(sim_info)

Bases: 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.

property sim_info

The Sim that changed.

Returns:

The Sim that changed.

Return type:

SimInfo

Sim Changed Toilet Usage

class S4CLSimChangedGenderOptionsToiletUsageEvent(sim_info)

Bases: 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.

property sim_info

The Sim that changed.

Returns:

The Sim that changed.

Return type:

SimInfo