Interface IClientEventAPI
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
Contains some client specific events you can hook into
public interface IClientEventAPI : IEventAPI
- Inherited Members
- Extension Methods
Methods
RegisterAsyncParticleSpawner(ContinousParticleSpawnTaskDelegate)
Set up an asynchronous particle spawner. The async particle simulation does most of the work in a seperate thread and thus runs a lot faster, with the down side of not being exaclty in sync with player interactions. This method of spawning particles is best suited for ambient particles, such as rain fall.
void RegisterAsyncParticleSpawner(ContinousParticleSpawnTaskDelegate handler)
Parameters
RegisterItemstackRenderer(CollectibleObject, ItemRenderDelegate, EnumItemRenderTarget)
Registers a custom itemstack renderer for given collectible object. If none is registered, the default renderer is used. For render target gui, the gui shader and its uniforms are already fully prepared, you may only call RenderMesh() and ignore the modelMat, position and size values - stack sizes however, are not covered by this.
void RegisterItemstackRenderer(CollectibleObject forObj, ItemRenderDelegate rendererDelegate, EnumItemRenderTarget target)
Parameters
forObj
CollectibleObjectrendererDelegate
ItemRenderDelegatetarget
EnumItemRenderTarget
RegisterRenderer(IRenderer, EnumRenderStage, string)
Registers a rendering handler to be called during every render frame
void RegisterRenderer(IRenderer renderer, EnumRenderStage renderStage, string profilingName = null)
Parameters
renderer
IRendererrenderStage
EnumRenderStageprofilingName
stringIf set, the frame profile will record the frame cost for this renderer
UnregisterItemstackRenderer(CollectibleObject, EnumItemRenderTarget)
Removes a previously registered itemstack renderer
void UnregisterItemstackRenderer(CollectibleObject forObj, EnumItemRenderTarget target)
Parameters
forObj
CollectibleObjecttarget
EnumItemRenderTarget
UnregisterRenderer(IRenderer, EnumRenderStage)
Removes a previously registered rendering handler.
void UnregisterRenderer(IRenderer renderer, EnumRenderStage renderStage)
Parameters
renderer
IRendererrenderStage
EnumRenderStage
Events
AfterActiveSlotChanged
Fired after a player changes their active slot (such as selected hotbar slot).
event Action<ActiveSlotChangeEventArgs> AfterActiveSlotChanged
Event Type
BeforeActiveSlotChanged
Fired before a player changes their active slot (such as selected hotbar slot). Allows for the event to be cancelled depending on the return value. Note: Not called when the server forcefully changes active slot.
event Func<ActiveSlotChangeEventArgs, EnumHandling> BeforeActiveSlotChanged
Event Type
BlockChanged
When a player block has been modified. OldBlock param may be null!
event BlockChangedDelegate BlockChanged
Event Type
BlockTexturesLoaded
Fired when server assets were received and all texture atlases have been created, also all sounds loaded
event Action BlockTexturesLoaded
Event Type
ChatMessage
Called when a chat message was received
event ChatLineDelegate ChatMessage
Event Type
ColorsPresetChanged
Fired when the GuiColorsPreset client setting is changed, since meshes may need to be redrawn
event Action ColorsPresetChanged
Event Type
FileDrop
Fired when the user drags&drops a file into the game window
event FileDropDelegate FileDrop
Event Type
HotkeysChanged
Called when the hotkeys are changed
event Action HotkeysChanged
Event Type
InGameDiscovery
Fired when something triggers a discovery event, such as the lore system
event IngameDiscoveryDelegate InGameDiscovery
Event Type
InGameError
Fired when something fires an ingame error
event IngameErrorDelegate InGameError
Event Type
IsPlayerReady
Fired when a player is ready to join but awaits any potential mod-user interaction, such as a character selection screen
event IsPlayerReadyDelegate IsPlayerReady
Event Type
KeyDown
Provides low level access to the key down event. If e.Handled is set to true, the event will not be handled by the game
event KeyEventDelegate KeyDown
Event Type
KeyUp
Provides low level access to the key up event. If e.Handled is set to true, the event will not be handled by the game
event KeyEventDelegate KeyUp
Event Type
LeaveWorld
When the player wants to leave the world to go back to the main menu
event Action LeaveWorld
Event Type
LeftWorld
When the player left the world to go back to the main menu
event Action LeftWorld
Event Type
LevelFinalize
Called when the client received the level finalize packet from the server
event Action LevelFinalize
Event Type
MouseDown
Provides low level access to the mouse down event. If e.Handled is set to true, the event will not be handled by the game
event MouseEventDelegate MouseDown
Event Type
MouseMove
Provides low level access to the mouse move event. If e.Handled is set to true, the event will not be handled by the game
event MouseEventDelegate MouseMove
Event Type
MouseUp
Provides low level access to the mouse up event. If e.Handled is set to true, the event will not be handled by the game
event MouseEventDelegate MouseUp
Event Type
OnSendChatMessage
Called before a chat message is sent to the server
event ClientChatLineDelegate OnSendChatMessage
Event Type
PauseResume
When the game was paused/resumed (only in single player)
event OnGamePauseResume PauseResume
Event Type
PlayerDeath
Called when the player dies
event PlayerEventDelegate PlayerDeath
Event Type
PlayerEntityDespawn
Called whenever a players got out of range
event PlayerEventDelegate PlayerEntityDespawn
Event Type
PlayerEntitySpawn
Called when a players entity got in range
event PlayerEventDelegate PlayerEntitySpawn
Event Type
PlayerJoin
Called when a player joins. The Entity of the player might be null if out of range!
event PlayerEventDelegate PlayerJoin
Event Type
PlayerLeave
Called whenever a player disconnects (timeout, leave, disconnect, kick, etc.). The Entity of the player might be null if out of range!
event PlayerEventDelegate PlayerLeave
Event Type
ReloadShader
Fired when the player tries to reload the shaders (happens when graphics settings are changed)
event ActionBoolReturn ReloadShader
Event Type
ReloadShapes
Called when shapes got reloaded
event Action ReloadShapes
Event Type
ReloadTextures
Called when textures got reloaded
event Action ReloadTextures
Event Type
TestBlockAccess
When player tries to modify a block
event TestBlockAccessDelegate TestBlockAccess