HytaleDocs
NPCSpawn

World

Asset path: Server/NPC/Spawn/World/*.json

A spawning configuration used to spawn NPCs around the world.

Parent

When set this asset will inherit properties from the named asset.

When inheriting from another WorldNPCSpawn most properties will simply be copied from the parent asset to this asset. In the case where both child and parent provide a field the child field will simply replace the value provided by the parent, in the case of nested structures this will apply to the fields within the structure. In some cases the field may decide to act differently, for example: by merging the parent and child fields together.

Type information: String

NPCs

A required list of Role Spawn Parameters defining each NPC that can be spawned and their relative weights.

Type information:

Array of the type: A set of parameters that configure spawning for a single NPC type.

RoleSpawnParameters with the following properties:

KeyTypeDescription
IdString

Reference to a NPCRole asset

The Role ID of the NPC to spawn.

WeightNumber defaults to: 0.0

The relative weight of this NPC (chance of being spawned is this value relative to the sum of all weights).

SpawnBlockSet(Nullable) String

Reference to a BlockSet asset

An optional BlockSet reference that defines which blocks this NPC can spawn on.

SpawnFluidTag(Nullable) String

An optional tag reference that defines which fluids this NPC can spawn on.

MovementModes(Nullable) Map of the following:
Map of MovementMode
KeyTypeDescription
WalkNumber

NPC will spawn on dry solid ground if permitted

WadeNumber

NPC will spawn in shallow water if permitted

UnderwaterWalkNumber

NPC will spawn on the ground underwater if permitted

DiveNumber

NPC will spawn fully submerged underwater if permitted

FlyNumber

NPC will spawn in the air flying

An optional map of movement modes with weights >0.0 that this NPC will use to spawn. If not set then the NPC will use backwards compatible defaults.

EnableSafeSpawningBoolean defaults to: true

When true (default), movement modes that are unsafe for this NPC's configuration are excluded from spawning. Set to false to allow spawning in all supported movement modes.

Flock(Nullable) Either String or FlockAsset

Reference to a FlockAsset asset

The optional flock definition to spawn around this NPC.

Despawn

Optional Despawn Parameters to control NPC despawning.

Type information:

(Nullable) A set of parameters that determine if NPCs should despawn.

DespawnParameters with the following properties:

KeyTypeDescription
DayTimeRange(Nullable) Array of Number

An optional hour range within which the NPCs will despawn (between 0 and 24). For Spawn Beacons, this refers to the beacon itself.

MoonPhaseRange(Nullable) Array of Integer

An optional moon phase range during which the NPCs will despawn (must be greater than or equal to 0). For Spawn Beacons, this refers to the beacon itself.

DayTimeRange

An optional hour range within which the NPCs/beacon will spawn (between 0 and 24).

Type information: (Nullable) Array of Number

MoonPhaseRange

An optional moon phase range during which the NPCs/beacon will spawn (must be greater than or equal to 0).

Type information: (Nullable) Array of Integer

LightRanges

Optional light ranges to spawn the NPCs/beacon in, defined between 0 and 100.

Type information:

(Nullable) Map of the following:

KeyTypeDescription
LightArray of Number

Total light level.

SkyLightArray of Number

Light level based on how deep under cover the position is relative to the open sky (e.g. inside a cave will be low SkyLight).

SunlightArray of Number

Light level based on time of day (peaks at around noon and is 0 during most of the night).

RedLightArray of Number

Red light level.

GreenLightArray of Number

Green light level.

BlueLightArray of Number

Blue light level.

ScaleDayTimeRange

If set to true, instead of using absolute hour values for DayTimeRange, it will be scaled based on the world's DaytimePortion.

  • 0 and 24 will represent the middle of the night portion.
  • 6 will represent the moment of sunrise.
  • 12 will represent the middle of the day portion.
  • 18 will represent the moment of sunset.

Type information: Boolean defaults to: true

Tags

Tags are a general way to describe an asset that can be interpreted by other systems in a way they see fit.

For example you could tag something with a Material tag with the values Solid and Stone, And another single tag Ore.

Tags will be expanded into a single list of tags automatically. Using the above example with Material and Ore the end result would be the following list of tags: Ore, Material, Solid, Stone, Material=Solid and Material=Stone.

Type information:

(Nullable) Map of the following:

KeyType
any StringArray of String

Environments

A required list of environments that this configuration covers. Each combination of environment and NPC in this configuration should be unique.

Type information: Array of String

Reference to a Environment asset

MoonPhaseWeightModifiers

An array of modifiers which will be multiplied into the weights for each NPC in this config dependent on the current moon phase.

At present, Hytale has 5 moon phases, with day 0 being a full moon which gradually wanes up to day 4 which is a new moon. These are represented in the array indices.

Each modifier can only be between 0 and 2, where 0 means the NPC will not spawn at all, 1 will use the standard weight, and 2 will result in twice the spawns

e.g. [ 0, 0, 0.5, 1, 2 ] would result in NPCs that do not spawn during day 0 and day 1 (full moon and three quarters), would spawn half as much on day 2, the defined amount on day 3, and twice as many on day 4 (new moon).

Type information: (Nullable) Array of Number

On this page