BeaconNPCSpawn
Documentation for the BeaconNPCSpawn asset type.
Location
NPC/Spawn/Beacons
Use in Your Files
Add this to your JSON files for IDE autocompletion and validation:
"$schema": "https://hytaledb.ginco.gg/schemas/BeaconNPCSpawn.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.
An optional model to represent the beacon in the world.
Environments array
A required list of environments that this configuration covers. Each combination of environment and NPC in this configuration should be unique. For Beacon NPC Spawn configurations, this can be left empty. In this case, these define the environments this beacon can be dynamically spawned in. If left empty, the beacon will not be dynamically spawned (e.g. if it should only be spawned by an objective).
Roughly how far the NPC should be spawned away from the player (this is a guideline and not an absolute).
A hard cutoff for how close an NPC can be spawned to the player to prevent the guideline distance above resulting in an NPC spawning too close to them.
YRange arraynull
The acceptable y range within which NPCs can be spawned from the beacon. This is defined as offsets from the beacon. With [ -5, 5 ], NPCs can be spawned from five blocks below the beacon up to five blocks above.
The maximum number of NPCs this beacon can have spawned at once.
ConcurrentSpawnsRange arraynull
The range from which a random number will be chosen that will represent the number of NPCs to be spawned in the next round between cooldowns.
SpawnAfterGameTimeRange arraynull
The random range from which to pick the next game-time based cooldown between spawns. This should be a duration string, e.g. [ "PT5M", "PT10M" ] which will spawn between 5 and 10 in-game minutes after the last spawn.
SpawnAfterRealTimeRange arraynull
The random range from which to pick the next real-time based cooldown between spawns. This should be a duration string, e.g. [ "PT30S", "PT80S" ] which will spawn between 30 and 80 seconds IRL after the last spawn.
InitialSpawnDelayRange arraynull
An optional range from which to pick an initial delay in real time seconds before which the first round of NPCs will be spawned after a beacon is created.
The number of seconds an NPC spawned by this beacon needs to spend idle before it will be despawned due to having no target. If NPCSpawnState is omitted, this will be ignored.
The amount of game time that needs to pass with no players present within the SpawnRadius before this beacon will remove itself. This should be a duration string.
The radius within which a spawned NPC is considered to be under the influence of the beacon and NPCs will be spawned for a player. If an NPC spawned by the beacon moves outside this radius and is not in a busy state, it will begin to tick down the NPCIdleDespawnTime (if being considered). It is recommended that this be ~25% larger than the SpawnRadius.
The radius within which NPCs spawns can physically happen (i.e. where their spawn points will be).
An optional state to force the NPC into upon spawn. If this state exists on the NPC, it will immediately enter the state upon spawn. For example, setting this to Chase will result in most NPCs immediately going for the player they were spawned around. If omitted, this beacon will allow idle NPCs.
As with NPCSpawnStat, but acts as an additional qualifier to define the desired substate.
The locked target slot to set the player to in the NPC.
An optional spawn suppression that will be tied to this beacon.
Whether this beacon should ignore any spawn suppressions.
MaxSpawnsScalingCurve unknown
A scaled response curve that represents the number of additional mobs to be added to the total MaxSpawnedNPCs based on the number of players within the beacon's max DistanceRange.
ConcurrentSpawnsScalingCurve unknown
A scaled response curve that represents the number of additional mobs to be added to the total MaxConcurrentSpawns based on the number of players within the beacon's max DistanceRange.
The debug mode. Can be used to print 2d maps of evaluated spawn regions.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "BeaconNPCSpawn.json",
"title": "BeaconNPCSpawn",
"description": "A spawning configuration used to spawn NPCs around the player when the player is within a specific radius from the beacon. When Environments are defined for the beacon, beacons of that type will be dynamically created while the player is in one of the specified environments.",
"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
},
"Model": {
"type": [
"string",
"null"
],
"description": "An optional model to represent the beacon in the world."
},
"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.\n\nFor Beacon NPC Spawn configurations, this can be left empty. In this case, these define the environments this beacon can be dynamically spawned in. If left empty, the beacon will not be dynamically spawned (e.g. if it should only be spawned by an objective).",
"items": {
"type": "string"
},
"uniqueItems": true
},
"TargetDistanceFromPlayer": {
"type": "number",
"description": "Roughly how far the NPC should be spawned away from the player (this is a guideline and not an absolute).",
"exclusiveMinimum": 0,
"default": 15
},
"MinDistanceFromPlayer": {
"type": "number",
"description": "A hard cutoff for how close an NPC can be spawned to the player to prevent the guideline distance above resulting in an NPC spawning too close to them.",
"exclusiveMinimum": 0,
"default": 5
},
"YRange": {
"type": [
"array",
"null"
],
"description": "The acceptable y range within which NPCs can be spawned from the beacon. This is defined as offsets from the beacon. With [ -5, 5 ], NPCs can be spawned from five blocks below the beacon up to five blocks above.",
"items": {
"type": "integer"
},
"minItems": 2,
"maxItems": 2
},
"MaxSpawnedNPCs": {
"type": "integer",
"description": "The maximum number of NPCs this beacon can have spawned at once.",
"exclusiveMinimum": 0,
"default": 1
},
"ConcurrentSpawnsRange": {
"type": [
"array",
"null"
],
"description": "The range from which a random number will be chosen that will represent the number of NPCs to be spawned in the next round between cooldowns.",
"items": {
"type": "integer"
},
"minItems": 2,
"maxItems": 2
},
"SpawnAfterGameTimeRange": {
"type": [
"array",
"null"
],
"description": "The random range from which to pick the next game-time based cooldown between spawns. This should be a duration string, e.g. [ \"PT5M\", \"PT10M\" ] which will spawn between 5 and 10 in-game minutes after the last spawn.",
"items": {
"type": "string"
},
"minItems": 2,
"maxItems": 2
},
"SpawnAfterRealTimeRange": {
"type": [
"array",
"null"
],
"description": "The random range from which to pick the next real-time based cooldown between spawns. This should be a duration string, e.g. [ \"PT30S\", \"PT80S\" ] which will spawn between 30 and 80 seconds IRL after the last spawn.",
"items": {
"type": "string"
},
"minItems": 2,
"maxItems": 2
},
"InitialSpawnDelayRange": {
"type": [
"array",
"null"
],
"description": "An optional range from which to pick an initial delay in real time seconds before which the first round of NPCs will be spawned after a beacon is created.",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
},
"NPCIdleDespawnTime": {
"type": "number",
"description": "The number of seconds an NPC spawned by this beacon needs to spend idle before it will be despawned due to having no target. If NPCSpawnState is omitted, this will be ignored.",
"markdownDescription": "The number of seconds an NPC spawned by this beacon needs to spend idle before it will be despawned due to having no target. If **NPCSpawnState** is omitted, this will be ignored.",
"exclusiveMinimum": 0,
"default": 10
},
"BeaconVacantDespawnGameTime": {
"type": [
"string",
"null"
],
"description": "The amount of game time that needs to pass with no players present within the SpawnRadius before this beacon will remove itself. This should be a duration string.",
"markdownDescription": "The amount of game time that needs to pass with no players present within the **SpawnRadius** before this beacon will remove itself. This should be a duration string."
},
"BeaconRadius": {
"type": "number",
"description": "The radius within which a spawned NPC is considered to be under the influence of the beacon and NPCs will be spawned for a player. If an NPC spawned by the beacon moves outside this radius and is not in a busy state, it will begin to tick down the NPCIdleDespawnTime (if being considered). It is recommended that this be ~25% larger than the SpawnRadius.",
"markdownDescription": "The radius within which a spawned NPC is considered to be under the influence of the beacon and NPCs will be spawned for a player. If an NPC spawned by the beacon moves outside this radius and is not in a busy state, it will begin to tick down the **NPCIdleDespawnTime** (if being considered). It is recommended that this be ~25% larger than the **SpawnRadius**.",
"exclusiveMinimum": 0,
"default": 20
},
"SpawnRadius": {
"type": "number",
"description": "The radius within which NPCs spawns can physically happen (i.e. where their spawn points will be).",
"exclusiveMinimum": 0,
"default": 15
},
"NPCSpawnState": {
"type": [
"string",
"null"
],
"description": "An optional state to force the NPC into upon spawn. If this state exists on the NPC, it will immediately enter the state upon spawn. For example, setting this to Chase will result in most NPCs immediately going for the player they were spawned around. If omitted, this beacon will allow idle NPCs.",
"markdownDescription": "An optional state to force the NPC into upon spawn. If this state exists on the NPC, it will immediately enter the state upon spawn. For example, setting this to **Chase** will result in most NPCs immediately going for the player they were spawned around. If omitted, this beacon will allow idle NPCs."
},
"NPCSpawnSubState": {
"type": [
"string",
"null"
],
"description": "As with NPCSpawnStat, but acts as an additional qualifier to define the desired substate.",
"markdownDescription": "As with **NPCSpawnStat**, but acts as an additional qualifier to define the desired substate."
},
"TargetSlot": {
"type": "string",
"description": "The locked target slot to set the player to in the NPC.",
"pattern": "[^\\s]",
"default": "LockedTarget",
"minLength": 1
},
"SpawnSuppression": {
"type": [
"string",
"null"
],
"description": "An optional spawn suppression that will be tied to this beacon."
},
"OverrideSpawnSuppressors": {
"type": "boolean",
"description": "Whether this beacon should ignore any spawn suppressions.",
"default": false
},
"MaxSpawnsScalingCurve": {
"description": "A scaled response curve that represents the number of additional mobs to be added to the total MaxSpawnedNPCs based on the number of players within the beacon's max DistanceRange.",
"markdownDescription": "A scaled response curve that represents the number of additional mobs to be added to the total **MaxSpawnedNPCs** based on the number of players within the beacon's max **DistanceRange**.",
"anyOf": [
{
"$ref": "common.schema.json#/$defs/ScaledXYResponseCurve"
},
{
"type": "null"
}
]
},
"ConcurrentSpawnsScalingCurve": {
"description": "A scaled response curve that represents the number of additional mobs to be added to the total MaxConcurrentSpawns based on the number of players within the beacon's max DistanceRange.",
"markdownDescription": "A scaled response curve that represents the number of additional mobs to be added to the total **MaxConcurrentSpawns** based on the number of players within the beacon's max **DistanceRange**.",
"anyOf": [
{
"$ref": "common.schema.json#/$defs/ScaledXYResponseCurve"
},
{
"type": "null"
}
]
},
"Debug": {
"type": [
"string",
"null"
],
"title": "Debug",
"description": "The debug mode. Can be used to print 2d maps of evaluated spawn regions.",
"enumDescriptions": [
"Disable map printing.",
"Print only irregular maps.",
"Print all maps."
],
"markdownEnumDescriptions": [
"Disable map printing.",
"Print only irregular maps.",
"Print all maps."
],
"enum": [
"Disabled",
"Irregularities",
"All"
],
"default": "Disabled"
}
}
}