Table of Contents

Class GlobalConstants

Namespace
Vintagestory.API.Config
Assembly
VintagestoryAPI.dll

Contains some global constants and static values

public class GlobalConstants
Inheritance
GlobalConstants
Inherited Members

Fields

AirDragAlways

Multiplier applied to entity motion while on the ground or in air

public static float AirDragAlways

Field Value

float

AirDragFlying

Multiplier applied to entity motion while flying (creative mode)

public static float AirDragFlying

Field Value

float

AllChatGroups

Special channel key typically to reply a Command inside the same the channel the player sent it

public static int AllChatGroups

Field Value

int

AllowedChatGroupChars

Allowed characters for a player group name

public static string AllowedChatGroupChars

Field Value

string

BaseJumpForce

Multiplier applied to the players jump motion

public static float BaseJumpForce

Field Value

float

BaseMoveSpeed

Multiplier applied to the players movement motion

public static float BaseMoveSpeed

Field Value

float

CaveArtColsPerRow

public static int CaveArtColsPerRow

Field Value

int

ChunkSize

Now a hard-coded constant

public const int ChunkSize = 32

Field Value

int

ConsoleGroup

Special channel key for message sent via server console

public static int ConsoleGroup

Field Value

int

CreatureDamageModifier

Global modifier to change the damage melee attacks from creatures inflict. Can be changed during run-time. The value is multiplied to the normal damage value (default: 1)

public static float CreatureDamageModifier

Field Value

float

CurrentChatGroup

Special channel key typically to reply a Command inside the same the channel the player sent it

public static int CurrentChatGroup

Field Value

int

CurrentDistanceToRainfallClient

Set by the SystemPlayerEnvAwarenessTracker System in the engine at the players position, once every second. 12 horizontal, 4 vertical search distance

public static float CurrentDistanceToRainfallClient

Field Value

float

CurrentNearbyRelLeavesCountClient

Set by the game client at the players position

public static float CurrentNearbyRelLeavesCountClient

Field Value

float

CurrentWindSpeedClient

Set by the WeatherSimulation System in the survival mod at the players position

public static Vec3f CurrentWindSpeedClient

Field Value

Vec3f

DamageLogChatGroup

Channel name for the damage chat log

public static int DamageLogChatGroup

Field Value

int

DefaultAttackRange

Attack range when using hands

public static float DefaultAttackRange

Field Value

float

DefaultChatGroups

public static int[] DefaultChatGroups

Field Value

int[]

DefaultCultureInfo

public static CultureInfo DefaultCultureInfo

Field Value

CultureInfo

DefaultDomain

Prefix for all default asset locations

public const string DefaultDomain = "game"

Field Value

string

DefaultPickingRange

Range in blocks a player can interact with blocks (break, use, place)

public static float DefaultPickingRange

Field Value

float

DefaultSimulationRange

Range in blocks at where this entity is simulated on the server (MagicNum.cs sets this value)

public static int DefaultSimulationRange

Field Value

int

DimensionSizeInChunks

Used in various places if the dimension of a chunk is combined into the chunk's y value.

public const int DimensionSizeInChunks = 1024

Field Value

int

EntityBlockFallingTypeCode

The entity class used when spawning falling blocks

public static AssetLocation EntityBlockFallingTypeCode

Field Value

AssetLocation

EntityItemTypeCode

The entity class used when spawning items in the world

public static AssetLocation EntityItemTypeCode

Field Value

AssetLocation

EntityPlayerTypeCode

The entity class used when spawning players

public static AssetLocation EntityPlayerTypeCode

Field Value

AssetLocation

GeneralChatGroup

Channel name for the general chat

public static int GeneralChatGroup

Field Value

int

GravityPerSecond

Amount of gravity per tick applied to all entities affected by gravity

public static float GravityPerSecond

Field Value

float

GravityStrengthParticle

A multiplier applied to the y motion of all particles affected by gravity.

public static float GravityStrengthParticle

Field Value

float

GuiGearRotJitter

public static float GuiGearRotJitter

Field Value

float

HungerSpeedModifier

Global modifier to change the rate of player hunger. Can be changed during run-time. The value is multiplied to the normal spoilage rate (default: 1)

public static float HungerSpeedModifier

Field Value

float

IgnoredStackAttributes

Default Itemstack attributes that should be ignored during a stack.Collectible.Equals() comparison

public static string[] IgnoredStackAttributes

Field Value

string[]

InfoLogChatGroup

Channel name for the info chat log

public static int InfoLogChatGroup

Field Value

int

MaxAnimatedElements

Max. amount of "bones" for animated model. Limited by max amount of shader uniforms of around 60, but depends on the gfx card

public static int MaxAnimatedElements

Field Value

int

MaxColorMaps

Max. amount of "bones" for color maps. Limited by max amount of shader uniforms, but depends on the gfx card

public const int MaxColorMaps = 40

Field Value

int

MaxPhysicsIntervalInSlowTicks

Limits the amount of world time that can be simulated by the physics engine if the server is ticking slowly: if ticks are slower than this, entities will seem to slow down (viewed on client might even jump backwards)
Recommended range 0.1f to 0.4f

public static float MaxPhysicsIntervalInSlowTicks

Field Value

float

MaxViewDistanceForLodBiases

public const int MaxViewDistanceForLodBiases = 640

Field Value

int

MaxWorldSizeXZ

Hard-enforced world size limit, above this the code may break

public const int MaxWorldSizeXZ = 67108864

Field Value

int

MaxWorldSizeY

Hard-enforced world height limit, above this the code may break.

public const int MaxWorldSizeY = 16384

Field Value

int

MeltingFreezingEnabled

Set by the weather simulation system to determine if snowed variants of blocks should melt. Used a static var to improve performance and reduce memory usage

public static bool MeltingFreezingEnabled

Field Value

bool

OverallSpeedMultiplier

Multiplied to all motions and animation speeds

public static float OverallSpeedMultiplier

Field Value

float

PerishSpeedModifier

Global modifier to change the spoil rate of foods. Can be changed during run-time. The value is multiplied to the normal spoilage rate (default: 1)

public static float PerishSpeedModifier

Field Value

float

PhysicsFrameTime

Frame time for physics simulation

public static float PhysicsFrameTime

Field Value

float

ServerInfoChatGroup

Channel name for the general chat

public static int ServerInfoChatGroup

Field Value

int

SinglePlayerEntitlements

Bit of a helper thing for single player servers to display the correct entitlements

public static string SinglePlayerEntitlements

Field Value

string

SneakSpeedMultiplier

Multiplier applied to the players sneaking motion

public static float SneakSpeedMultiplier

Field Value

float

SprintSpeedMultiplier

Multiplier applied to the players sprinting motion

public static double SprintSpeedMultiplier

Field Value

double

TimeToDespawnPlayerInventoryDrops

Time in seconds for dropped items to remain when dropped after player death; overrides the despawn time set in item.json

public static int TimeToDespawnPlayerInventoryDrops

Field Value

int

ToolMiningSpeedModifier

Global modifier to change the block breaking speed of all tools. Can be changed during run-time. The value is multiplied to the breaking speed (default: 1)

public static float ToolMiningSpeedModifier

Field Value

float

WaterDrag

Multiplier applied to entity motion while walking in water

public static float WaterDrag

Field Value

float

WorldSaveExtension

public const string WorldSaveExtension = ".vcdbs"

Field Value

string

backpackInvClassName

public const string backpackInvClassName = "backpack"

Field Value

string

characterInvClassName

public const string characterInvClassName = "character"

Field Value

string

craftingInvClassName

public const string craftingInvClassName = "craftinggrid"

Field Value

string

creativeInvClassName

public const string creativeInvClassName = "creative"

Field Value

string

groundInvClassName

public const string groundInvClassName = "ground"

Field Value

string

hotBarInvClassName

public const string hotBarInvClassName = "hotbar"

Field Value

string

mousecursorInvClassName

public const string mousecursorInvClassName = "mouse"

Field Value

string

playerColorByEntitlement

public static Dictionary<string, double[]> playerColorByEntitlement

Field Value

Dictionary<string, double[]>

playerTagBackgroundByEntitlement

public static Dictionary<string, TextBackground> playerTagBackgroundByEntitlement

Field Value

Dictionary<string, TextBackground>

Properties

FoodSpoilHealthLossMulHandler

public static FoodSpoilageCalcDelegate FoodSpoilHealthLossMulHandler { get; }

Property Value

FoodSpoilageCalcDelegate

FoodSpoilSatLossMulHandler

public static FoodSpoilageCalcDelegate FoodSpoilSatLossMulHandler { get; }

Property Value

FoodSpoilageCalcDelegate

Methods

FoodSpoilageHealthLossMul(float, ItemStack, EntityAgent)

public static float FoodSpoilageHealthLossMul(float spoilState, ItemStack stack, EntityAgent byEntity)

Parameters

spoilState float
stack ItemStack
byEntity EntityAgent

Returns

float

FoodSpoilageSatLossMul(float, ItemStack, EntityAgent)

public static float FoodSpoilageSatLossMul(float spoilState, ItemStack stack, EntityAgent byEntity)

Parameters

spoilState float
stack ItemStack
byEntity EntityAgent

Returns

float

OutsideWorld(double, double, double, IBlockAccessor)

Returns true if the player fell out of the world (which is map boundaries + 30 blocks in every direction)

public static bool OutsideWorld(double x, double y, double z, IBlockAccessor blockAccessor)

Parameters

x double
y double
z double
blockAccessor IBlockAccessor

Returns

bool

OutsideWorld(int, int, int, IBlockAccessor)

Returns true if the player fell out of the world (which is map boundaries + 30 blocks in every direction)

public static bool OutsideWorld(int x, int y, int z, IBlockAccessor blockAccessor)

Parameters

x int
y int
z int
blockAccessor IBlockAccessor

Returns

bool