Join our discord
In partnership with NodeCraft Logo NodeCraft


You are not logged in! Create an account or login to contribute! Log in here!

Better Spawner/Config

From Pixelmon Wiki

The Better Spawner Config is a special data file located under ./data/pixelmon/config/betterspawnerconfig.json in the Pixelmon mod file. It is used for more advanced configuration of the Better Spawner's behaviour.

To modify this config, you can override it via Data Pack.

Properties

"globalCompositeCondition"

The global composite condition is a composite condition that is applied to all SpawnInfo of all types. There are many applications for this, such as creating areas where nothing can spawn, or making particular dimensions only spawn entities during a certain moon phase, to name just two. As an example, the following is how to do both of the above:

"globalCompositeCondition": {
    "conditions": [
        {
            "dimensions": [
                "minecraft:overworld"
            ]
        },
        {
	    "dimensions": [
	        "minecraft:the_end"
	    ],
	    "moonPhase": 0
	}
    ],
    "anticonditions": [
        {
	    "minX": 50,
	    "maxX": 120,
	    "minZ": 0,
	    "maxZ": 200,
	    "dimensions": [
	        "minecraft:overworld"
	    ]
	}
    ]
},

This would allow spawns anywhere in the Overworld except for the area between the coordinates 50|~|0 and 120|~|200 (minY and maxY are not specified, so this restriction applies over the entire world height). Additionally the End dimension can spawn Pokémon during the full moon only.

By default, the global composite condition allows spawns in all Vanilla Minecraft and Pixelmon dimensions, as well as setting the requirement of enough space for Legendaries and Ultra Beasts to spawn.



"autoTagSpecs"

Better Spawner/Config comes pre-listed with some auto-generated tags that link to existing Pokémon specs. You can use these in your "globalCompositeCondition" or "intervalSeconds" without having to set the tags in each individual Pokémon's JSON. Listed is what is currently provided for this section:

"autoTagSpecs": {
    "shiny": "shiny",
    "gen1": "generation:1",
    "gen2": "generation:2",
    "gen3": "generation:3",
    "gen4": "generation:4",
    "gen5": "generation:5",
    "gen6": "generation:6",
    "gen7": "generation:7",
    "gen8": "generation:8",
    "legendary": "islegendary:true",
    "nonlegendary": "islegendary:false"
},



"intervalSeconds"

The interval seconds are used to guarantee particular kinds of spawns cannot happen too often in a window of time. By default, the two SpawnInfos for Ultra Wormholes for example have the property "interval": "wormhole_overworld" and "interval": "wormhole_ultra_space" respectively, in which case when one is about to spawn it will stop if another entity with that interval has spawned recently.

This property is to specify how long "recently" is. In this case, Wormholes in the Overworld can spawn at most once per minute (1200 ticks = 60 seconds = 1 minute) while Ultra Space can spawn up to one every 20 seconds (400 ticks = 20 seconds):

"intervalSeconds": {
    "wormhole_ultra_space": 400,
    "wormhole_overworld": 1200
},

You can also use this section to create custom intervals for things such as Pokémon flying in the Air. You would create the tag name you want to use, in this case "flying": 500, and then add it into the "intervalSeconds" section as a new entry. You would then add the interval to the individual Pokémon's JSON as such:

"minLevel": 35,
"maxLevel": 55,
"interval": "flying",
"typeID": "pokemon",

The interval restriction affects everything that uses the Better Spawner.



"blockCategories"

The block categories are a type of category used for several LocationTypes and in the baseBlocks and neededNearbyBlocks properties of SpawnConditions. More on categories can be read here.



"biomeCategories"

The biome categories are a type of category used in the stringBiomes property of SpawnConditions and in world generation in one special case. The "all forests" biome category is the only one strictly necessary as Hidden Grotto world generation checks this category to know where to generate these. More on categories can be read here.


Trivia

Before the integration into Minecraft's Data Pack system with Pixelmon version 9.x, the Better Spawner Config was an optional config file, which could be activated by setting the useBetterSpawnerConfig option to true in the Pixelmon Hocon. This would then generate out an external copy of the file under ./config/pixelmon/BetterSpawnerConfig.json on restart, which players could edit and would apply globally for that Minecraft installation.

© 2012 - 2022 Pixelmon Mod