Skip to content

BeaconNPCSpawn

← Back to Asset Types

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.

Array items: RoleSpawnParameters
Despawn unknown

Optional Despawn Parameters to control NPC despawning.

Any of
DespawnParameters
null
DayTimeRange arraynull

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

Array items: number
MoonPhaseRange arraynull

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

Array items: integer
LightRanges objectnull

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

Light array

Total light level.

Array items: number
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).

Array items: number
Sunlight array

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

Array items: number
RedLight array

Red light level.

Array items: number
GreenLight array

Green light level.

Array items: number
BlueLight array

Blue light level.

Array items: number
Additional properties: array
ScaleDayTimeRange boolean

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.

Default:true
Model stringnull

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).

Array items: string
TargetDistanceFromPlayer number

Roughly how far the NPC should be spawned away from the player (this is a guideline and not an absolute).

Default:15
Min (exclusive): 0
MinDistanceFromPlayer number

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.

Default:5
Min (exclusive): 0
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.

Array items: integer
MaxSpawnedNPCs integer

The maximum number of NPCs this beacon can have spawned at once.

Default:1
Min (exclusive): 0
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.

Array items: integer
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.

Array items: string
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.

Array items: string
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.

Array items: number
NPCIdleDespawnTime number

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.

Default:10
Min (exclusive): 0
BeaconVacantDespawnGameTime stringnull

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 number

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.

Default:20
Min (exclusive): 0
SpawnRadius number

The radius within which NPCs spawns can physically happen (i.e. where their spawn points will be).

Default:15
Min (exclusive): 0
NPCSpawnState stringnull

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 stringnull

As with NPCSpawnStat, but acts as an additional qualifier to define the desired substate.

TargetSlot string

The locked target slot to set the player to in the NPC.

Default:"LockedTarget"
Pattern:[^\s]
SpawnSuppression stringnull

An optional spawn suppression that will be tied to this beacon.

OverrideSpawnSuppressors boolean

Whether this beacon should ignore any spawn suppressions.

Default:false
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.

Any of
ScaledXYResponseCurve
null
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.

Any of
ScaledXYResponseCurve
null
Debug stringnull

The debug mode. Can be used to print 2d maps of evaluated spawn regions.

Enum:"Disabled""Irregularities""All"
Default:"Disabled"
All of
base