Table of Contents

Class BaseSpawnConditions

Namespace
Vintagestory.API.Common.Entities
Assembly
VintagestoryAPI.dll

A base class for entities spawning conditions.

public class BaseSpawnConditions : ClimateSpawnCondition
Inheritance
BaseSpawnConditions
Derived
Inherited Members
Extension Methods

Fields

ClimateValueMode

Whether the rain and temperature values are referring to the worldgen values (i.e. yearly averages) or the current values at the moment of spawning.

public EnumGetClimateMode ClimateValueMode

Field Value

EnumGetClimateMode

Companions

Additional companions for the spawn.

public AssetLocation[] Companions

Field Value

AssetLocation[]

Group

The group of the spawn conditions. Vanilla groups are:

  • hostile
  • neutral
  • passive
    Hostile creatures should be defined as such here. This will automatically stop them spawning with a grace timer, and in locations where hostiles should not spawn.
public string Group

Field Value

string

HerdSize

the group size for the spawn.

public NatFloat HerdSize

Field Value

NatFloat

InsideBlockCodes

The blocks that the object will spawn in.

public AssetLocation[] InsideBlockCodes

Field Value

AssetLocation[]

InsideBlockCodesBeginsWith

protected string[] InsideBlockCodesBeginsWith

Field Value

string[]

InsideBlockCodesExact

protected string[] InsideBlockCodesExact

Field Value

string[]

InsideBlockCodesResolved

protected HashSet<Block> InsideBlockCodesResolved

Field Value

HashSet<Block>

InsideBlockFirstLetters

protected string InsideBlockFirstLetters

Field Value

string

LightLevelType

The type of light counted for spawning purposes.

public EnumLightLevelType LightLevelType

Field Value

EnumLightLevelType

MaxLightLevel

The maximum light level for an object to spawn.

public int MaxLightLevel

Field Value

int

MinLightLevel

The minimum light level for an object to spawn.

public int MinLightLevel

Field Value

int

RequireSolidGround

Checks to see if the object requires solid ground.

public bool RequireSolidGround

Field Value

bool

TryOnlySurface

checks to see if the object can only spawn in the surface.

public bool TryOnlySurface

Field Value

bool

Properties

GroupSize

Obsolete. Use HerdSize instead.

[Obsolete("Use HerdSize instead")]
public NatFloat GroupSize { get; set; }

Property Value

NatFloat

Methods

CanSpawnInside(Block)

public bool CanSpawnInside(Block testBlock)

Parameters

testBlock Block

Returns

bool

Initialise(IServerWorldAccessor, string, Dictionary<AssetLocation, Block[]>)

public void Initialise(IServerWorldAccessor server, string entityName, Dictionary<AssetLocation, Block[]> searchCache)

Parameters

server IServerWorldAccessor
entityName string
searchCache Dictionary<AssetLocation, Block[]>