Sim Event Types

Sim Added Occult Type Event

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

Sim Changed Age Event

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 an Adult Sim becomes an Elder Sim or an Elder Sim becomes an Adult 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: S4CLSimChangedAgeEvent):
        pass
Parameters:
  • sim_info (SimInfo) – The Sim that changed Ages.
  • old_age (Age) – The Age the Sim has changed from.
  • new_age (Age) – The Age the Sim has changed to.
new_age

The Age the Sim has changed to.

Returns:The Age the Sim has changed to.
Return type:Age
old_age

The Age the Sim has changed from.

Returns:The Age the Sim has changed from.
Return type:Age
sim_info

The Sim that changed Ages.

Returns:The Sim that changed Ages.
Return type:SimInfo

Sim Changed Occult Type Event

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

Sim Initialized Event

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 Event

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 Removed Occult Type Event

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

Sim Spawned Event

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