Build/Buy Event Types

Build/Buy Enter Event

class S4CLBuildBuyEnterEvent(zone)

Bases: sims4communitylib.events.event_handling.common_event.CommonEvent

An event that occurs upon entering Build/Buy on a lot.

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: S4CLBuildBuyEnterEvent):
        pass
Parameters:zone (Zone) – The zone the player has entered Build/Buy on.
zone

The zone the event occurred on.

Returns:The zone the event occurred on.
Return type:Zone

Build/Buy Exit Event

class S4CLBuildBuyExitEvent(zone: <sphinx.ext.autodoc.importer._MockObject object at 0x7f2659eeeb50>)

Bases: sims4communitylib.events.event_handling.common_event.CommonEvent

S4CLBuildBuyEnterEvent(zone)

An event that occurs upon exiting Build/Buy on a lot.

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: S4CLBuildBuyExitEvent):
        pass
Parameters:zone (Zone) – The zone the player has exited Build/Buy on.
zone

The zone the event occurred on.

Returns:The zone the event occurred on.
Return type:Zone