Optional LivingHandler Settings - ProjectZulu/JustAnotherSpawner GitHub Wiki
As noted the Living Handler is an internal concept that represents properties unique to a given entity. By default the only options in the configuration file are the entity Category and a global toggle for whether the entity should spawn.
There are additional properties that can be toggled. These can be used to control the spawning and despawning behavior.
Auto-Converting Old Configuration Files
Previous Version of JAS used the format:
creatureType-shouldSpawn-forceDespawn-useModLocation
which as of JASv0.3.0 is outdated. Any entity encountered in game with this format will be converted to the optional format. Since the default values for forceDespawn and useModLocation are used if no optional paramters are provided, if they are defaults (false, true respectively) then no optional tags are added. The table below illustrates the conversion.
JAS v0.2.0 Format | JAS v0.3.0 Format |
---|---|
MONSTER-true-false-true |
MONSTER-true |
MONSTER-true-true-false |
MONSTER-true{despawn} |
MONSTER-true-false-true |
MONSTER-true{spawn} |
MONSTER-true-true-false |
MONSTER-true{spawn}{despawn} |
Adding Extra Parameters
The typical format for livingHandlers is: CreatureType-shouldSpawn
additional properties are added using a
"tag" system. Simply add {tagName}
to the end of the regular format string to enable the property. Additional properties unique to the tag are added by placing :
after the tag name. For Example
CreatureType-shouldSpawn{tagName:tagProp,propVal0:tagProp,propVal1,propVal2}
For the a given tag format the "tagName" must come first. The order of the property tags, on the other hand, doesn't matter. For example, the two below spawn strings are equivalent.
(1) {spawn:light,0,2:block,2>4-4}
(2) {spawn:block,2>4-4:light,0,2}
Tag
There are currently two tags. Spawn controls the spawn condition of the entity. While despawn specifies the despawn conditions.
Spawn Tag
If this tag is present the default getCanSpawnHere Check for the entity will be skipped. In its place simple bounding box check will be performed. There are two property tags to further restrict the desired spawning location: Light, and Block. As of JASv0.4 the spawn tag is invertible by marking it with a exclamation mark (!spawn
). Instead assuming entity can spawn, and using properties tags to mark when it cannot the entity location is assumed to be invalid and properties specify when it valid. Note that in either case a clear bounding box will be required to spawn.
- Light: Restricts the valid spawning location to be between min and max light level, inclusively.
- Block: Restricts the Blocks that the entity is allowed to spawn on.
- Sky: Restricts by forcing entity to need sky. Invertable with !sky.
- Cap: Marks the Maximum of this type of entity that will spawn.
- Spawn Height: Two separate tags to mark min/max valid height
Despawn Tag
Restricts the conditions for despawning. Any entity with this tag has its persistenceRequired NBT tag set to override regular despawning. The entity is polled every 60 ticks to attempt to despawn. The following property tags restrict the conditions for despawning. As of JASv0.4 the Despawn tag is invertible by marking it with a exclamation mark (!despawn
). Instead despawning, and using properties tags to mark when to be persistent the entity will be persistent and sub-properties will tell it when to despawn. Note persistence entities do not despawn at any range.
- Light: Valid light level such that the entity does not despawn.
- Block: Valid block and meta to ensure the entity does not despawn.
- BlockRange: The range of blocks nearby that should be searched. Has two formations: format 1,
- SpawnRate: Determines the propbability that the entity will despawn. Quantity approximatly represents the number of ticks the entity will take to despawn once other conditions are met.
- Sky: Restricts by forcing entity to need sky. Invertible with !sky.
- SpawnRange: Marks the minimum distance an entity will be eligible for despawning.
- Spawn Height: Two separate tags to mark min/max valid height
Property Tags
While the Individual property tags may be interpreted differently for a given tag their format is identical to reduce confusion.
Light
Format: {:light,minLightLevel,maxLightLevel}
.
Block
The format is variable.
-
seperated blockID from Meta.
'>' seperates min and max range of ids.
',' sperates multiple entries.
Block with Meta :1-2
Block Without Meta (assumes 0) :block,1
Range of BlockIDS (inclusive) (every block meta is 0) :block,1>20
Range of BlockIDS (inclusive) (every block meta is 2) :block,1>20-2
Range of BlockIDS (inclusive) (every block meta is 2 and 3) :block,1>20-2>3
Multiple Block-Meta Range :block,1>20-2>4,30-1,30-3>4,25
BlockRange
Format 1 (assumes isotropic): :blockRange,range
Format 2: :blockRange,rangeX, rangeY, rangeZ
Spawnrate
Format: :spawnRate,ticks
The Following were introduced in JASv0.4.0
spawnRange
Format: :spawnRange,range
Need/No Sky
Format: :sky
or :!sky
Entity Cap
Format: :cap,maximumAmountNum
SpawnHeight
Format: :minSpawnHeight, minHeightNum
Format: :maxSpawnHeight, maxHeightNum