WorldNPCSpawn
Documentation for the WorldNPCSpawn asset type.
Location
NPC/Spawn/World
Use in Your Files
Add this to your JSON files for IDE autocompletion and validation:
"$schema": "https://hytaledb.ginco.gg/schemas/WorldNPCSpawn.schema.json" Schema
NPCs array
A required list of Role Spawn Parameters defining each NPC that can be spawned and their relative weights.
Despawn unknown
Optional Despawn Parameters to control NPC despawning.
DayTimeRange arraynull
An optional hour range within which the NPCs/beacon will spawn (between 0 and 24).
MoonPhaseRange arraynull
An optional moon phase range during which the NPCs/beacon will spawn (must be greater than or equal to 0).
LightRanges objectnull
Optional light ranges to spawn the NPCs/beacon in, defined between 0 and 100.
Light array
Total light level.
SkyLight array
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).
Sunlight array
Light level based on time of day (peaks at around noon and is 0 during most of the night).
RedLight array
Red light level.
GreenLight array
Green light level.
BlueLight array
Blue light level.
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.
Environments array
A required list of environments that this configuration covers. Each combination of environment and NPC in this configuration should be unique.
MoonPhaseWeightModifiers arraynull
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).
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "WorldNPCSpawn.json",
"title": "WorldNPCSpawn",
"description": "A spawning configuration used to spawn NPCs around the world.",
"type": "object",
"allOf": [
{
"$ref": "base.schema.json"
}
],
"properties": {
"NPCs": {
"type": "array",
"description": "A required list of Role Spawn Parameters defining each NPC that can be spawned and their relative weights.",
"markdownDescription": "A required list of **Role Spawn Parameters** defining each NPC that can be spawned and their relative weights.",
"items": {
"$ref": "common.schema.json#/$defs/RoleSpawnParameters"
},
"minItems": 1
},
"Despawn": {
"description": "Optional Despawn Parameters to control NPC despawning.",
"markdownDescription": "Optional **Despawn Parameters** to control NPC despawning.",
"anyOf": [
{
"$ref": "common.schema.json#/$defs/DespawnParameters"
},
{
"type": "null"
}
]
},
"DayTimeRange": {
"type": [
"array",
"null"
],
"description": "An optional hour range within which the NPCs/beacon will spawn (between 0 and 24).",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
},
"MoonPhaseRange": {
"type": [
"array",
"null"
],
"description": "An optional moon phase range during which the NPCs/beacon will spawn (must be greater than or equal to 0).",
"items": {
"type": "integer"
},
"minItems": 2,
"maxItems": 2
},
"LightRanges": {
"type": [
"object",
"null"
],
"title": "Map of LightType",
"description": "Optional light ranges to spawn the NPCs/beacon in, defined between 0 and 100.",
"properties": {
"Light": {
"type": "array",
"description": "Total light level.",
"items": {
"type": "number"
}
},
"SkyLight": {
"type": "array",
"description": "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).",
"items": {
"type": "number"
}
},
"Sunlight": {
"type": "array",
"description": "Light level based on time of day (peaks at around noon and is 0 during most of the night).",
"items": {
"type": "number"
}
},
"RedLight": {
"type": "array",
"description": "Red light level.",
"items": {
"type": "number"
}
},
"GreenLight": {
"type": "array",
"description": "Green light level.",
"items": {
"type": "number"
}
},
"BlueLight": {
"type": "array",
"description": "Blue light level.",
"items": {
"type": "number"
}
}
},
"additionalProperties": {
"type": "array",
"items": {
"type": "number"
}
},
"propertyNames": {
"enum": [
"Light",
"SkyLight",
"Sunlight",
"RedLight",
"GreenLight",
"BlueLight"
]
}
},
"ScaleDayTimeRange": {
"type": "boolean",
"description": "If set to true, instead of using absolute hour values for DayTimeRange, it will be scaled based on the world's DaytimePortion.\n\n * 0 and 24 will represent the middle of the night portion.\n * 6 will represent the moment of sunrise.\n * 12 will represent the middle of the day portion.\n * 18 will represent the moment of sunset.",
"default": true
},
"Environments": {
"type": "array",
"description": "A required list of environments that this configuration covers. Each combination of environment and NPC in this configuration should be unique.",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
},
"MoonPhaseWeightModifiers": {
"type": [
"array",
"null"
],
"description": "An array of modifiers which will be multiplied into the weights for each NPC in this config dependent on the current moon phase.\n\nAt 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.\n\nEach 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\n\ne.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).",
"markdownDescription": "An array of modifiers which will be multiplied into the weights for each NPC in this config dependent on the current moon phase.\n\nAt 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.\n\nEach 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\n\ne.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).",
"items": {
"type": "number",
"minimum": 0,
"maximum": 2
}
}
}
}