Table of Contents

Interface IClientWorldAccessor

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll

The world accessor implemented by the client, offers some extra features only available on the client

public interface IClientWorldAccessor : IWorldAccessor
Inherited Members

Properties

AmbientParticles

Whether to spawn ambient particles

bool AmbientParticles { get; set; }

Property Value

bool

Calendar

Interface to access the game calendar

IClientGameCalendar Calendar { get; }

Property Value

IClientGameCalendar

Dimensions

Dictionary<int, IMiniDimension> Dimensions { get; }

Property Value

Dictionary<int, IMiniDimension>

ForceLiquidSelectable

Whether the player can select liquids

bool ForceLiquidSelectable { get; set; }

Property Value

bool

LoadedEntities

The internal cache of all currently loaded entities. Warning: You should not set or remove anything from this dic unless you really know what you're doing. Use SpawnEntity/DespawnEntity instead.

Dictionary<long, Entity> LoadedEntities { get; }

Property Value

Dictionary<long, Entity>

Player

Returns the player running this client instance

IClientPlayer Player { get; }

Property Value

IClientPlayer

Methods

AddCameraShake(float)

Shakes the camera view by given strength

void AddCameraShake(float strengh)

Parameters

strengh float

ApplyColorMapOnRgba(string, string, int, int, int, bool)

Loads the rgb climate and season color map value for given rain and temp value and multiplies it byte-wise with supplied color

int ApplyColorMapOnRgba(string climateColorMap, string seasonColorMap, int color, int rain, int temp, bool flipRb = true)

Parameters

climateColorMap string
seasonColorMap string
color int
rain int
temp int
flipRb bool

Returns

int

ApplyColorMapOnRgba(string, string, int, int, int, int, bool)

Loads the rgb climate and season color map value at given position and multiplies it byte-wise with supplied color

int ApplyColorMapOnRgba(string climateColorMap, string seasonColorMap, int color, int posX, int posY, int posZ, bool flipRb = true)

Parameters

climateColorMap string
seasonColorMap string
color int
posX int
posY int
posZ int
flipRb bool

Returns

int

ApplyColorMapOnRgba(ColorMap, ColorMap, int, int, int, int, bool)

int ApplyColorMapOnRgba(ColorMap climateColorMap, ColorMap seasonColorMap, int color, int posX, int posY, int posZ, bool flipRb = true)

Parameters

climateColorMap ColorMap
seasonColorMap ColorMap
color int
posX int
posY int
posZ int
flipRb bool

Returns

int

CloneBlockDamage(BlockPos, BlockPos)

Applies the same damage overlay effect on the target as the source has

void CloneBlockDamage(BlockPos sourcePos, BlockPos targetPos)

Parameters

sourcePos BlockPos
targetPos BlockPos

GetColorMapData(Block, int, int, int)

ColorMapData GetColorMapData(Block block, int posX, int posY, int posZ)

Parameters

block Block
posX int
posY int
posZ int

Returns

ColorMapData

GetOrCreateDimension(int, Vec3d)

IMiniDimension GetOrCreateDimension(int dimId, Vec3d pos)

Parameters

dimId int
pos Vec3d

Returns

IMiniDimension

IncurBlockDamage(BlockSelection, EnumTool?, float)

Same effect as when player left-click breaks a block, but will not cause actual breakage of the block

void IncurBlockDamage(BlockSelection blockSelection, EnumTool? withTool, float damage)

Parameters

blockSelection BlockSelection
withTool EnumTool?
damage float

LoadSound(SoundParams)

Loads a sounds without playing it. Use to individually control when to play/stop. Might want to set DisposeOnFinish to false but then you have to dispose it yourself.

ILoadedSound LoadSound(SoundParams param)

Parameters

param SoundParams

Returns

ILoadedSound

PlaySoundAtAndGetDuration(AssetLocation, double, double, double, IPlayer, bool, float, float)

Exactly like PlaySoundAt except that it returns the duration of the played sound. (We don't want to change the method signature of PlaySoundAt for API mod breakage reasons)

int PlaySoundAtAndGetDuration(AssetLocation sound, double x, double y, double z, IPlayer ignorePlayerUid = null, bool randomizePitch = true, float range = 32, float volume = 1)

Parameters

sound AssetLocation
x double
y double
z double
ignorePlayerUid IPlayer
randomizePitch bool
range float
volume float

Returns

int

ReduceCameraShake(float)

void ReduceCameraShake(float amount)

Parameters

amount float

SetBlocksPreviewDimension(int)

void SetBlocksPreviewDimension(int dimId)

Parameters

dimId int

SetCameraShake(float)

void SetCameraShake(float strengh)

Parameters

strengh float

TryAttackEntity(EntitySelection)

Makes an attempt to attack a particular entity.

void TryAttackEntity(EntitySelection sele)

Parameters

sele EntitySelection

TryGetMiniDimension(Vec3i, out IMiniDimension)

bool TryGetMiniDimension(Vec3i origin, out IMiniDimension dimension)

Parameters

origin Vec3i
dimension IMiniDimension

Returns

bool