Skip to main content
Version: 15.x (API 15) [Current]

Interface IAgentLifecycle

This class provides events for in-game agent lifecycles.

Assembly: Dalamud.dll​
Declaration
public interface IAgentLifecycle : IDalamudService

Methods​

RegisterListener(AgentEvent, IEnumerable<AgentId>, AgentEventDelegate)​

Register a listener that will trigger on the specified event and any of the specified agent.

Declaration
void RegisterListener(AgentEvent eventType, IEnumerable<AgentId> agentIds, IAgentLifecycle.AgentEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Agent.AgentEventeventTypeEvent type to trigger on.
System.Collections.Generic.IEnumerable<Dalamud.Game.Agent.AgentId>agentIdsAgent IDs that will trigger the handler to be invoked.
Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegatehandlerThe handler to invoke.

RegisterListener(AgentEvent, AgentId, AgentEventDelegate)​

Register a listener that will trigger on the specified event only for the specified agent.

Declaration
void RegisterListener(AgentEvent eventType, AgentId agentId, IAgentLifecycle.AgentEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Agent.AgentEventeventTypeEvent type to trigger on.
Dalamud.Game.Agent.AgentIdagentIdThe agent ID that will trigger the handler to be invoked.
Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegatehandlerThe handler to invoke.

RegisterListener(AgentEvent, AgentEventDelegate)​

Register a listener that will trigger on the specified event for any agent.

Declaration
void RegisterListener(AgentEvent eventType, IAgentLifecycle.AgentEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Agent.AgentEventeventTypeEvent type to trigger on.
Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegatehandlerThe handler to invoke.

UnregisterListener(AgentEvent, IEnumerable<AgentId>, AgentEventDelegate)​

Unregister listener from specified event type and specified agent IDs.

Declaration
void UnregisterListener(AgentEvent eventType, IEnumerable<AgentId> agentIds, IAgentLifecycle.AgentEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Agent.AgentEventeventTypeEvent type to deregister.
System.Collections.Generic.IEnumerable<Dalamud.Game.Agent.AgentId>agentIdsAgent IDs to deregister.
Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegatehandlerOptional specific handler to remove.
Remarks​

If a specific handler is not provided, all handlers for the event type and agent IDs will be unregistered.

UnregisterListener(AgentEvent, AgentId, AgentEventDelegate)​

Unregister all listeners for the specified event type and agent ID.

Declaration
void UnregisterListener(AgentEvent eventType, AgentId agentId, IAgentLifecycle.AgentEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Agent.AgentEventeventTypeEvent type to deregister.
Dalamud.Game.Agent.AgentIdagentIdAgent id to deregister.
Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegatehandlerOptional specific handler to remove.
Remarks​

If a specific handler is not provided, all handlers for the event type and agents will be unregistered.

UnregisterListener(AgentEvent, AgentEventDelegate)​

Unregister an event type handler.

This will only remove a handler that is added via Dalamud.Plugin.Services.IAgentLifecycle.RegisterListener(Dalamud.Game.Agent.AgentEvent,Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegate).

Declaration
void UnregisterListener(AgentEvent eventType, IAgentLifecycle.AgentEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Agent.AgentEventeventTypeEvent type to deregister.
Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegatehandlerOptional specific handler to remove.
Remarks​

If a specific handler is not provided, all handlers for the event type and agents will be unregistered.

UnregisterListener(params AgentEventDelegate[])​

Unregister all events that use the specified handlers.

Declaration
void UnregisterListener(params IAgentLifecycle.AgentEventDelegate[] handlers)
Parameters​
TypeNameDescription
Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegate[]handlersHandlers to remove.

GetOriginalVirtualTable(nint)​

Resolves an agents virtual table address back to the original unmodified table address.

Declaration
nint GetOriginalVirtualTable(nint virtualTableAddress)
Returns​

System.IntPtr: The address of the agents original virtual table.

Parameters​
TypeNameDescription
System.IntPtrvirtualTableAddressThe address of a modified agents virtual table.