Join our discord
In partnership with NodeCraft Logo NodeCraft


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

Difference between revisions of "Better Spawner"

From Pixelmon Wiki
(Added an SEO tag and a proper stub marker, and updated some minor things. Still needs work.)
m
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
<seo metakeywords="better, beta, spawner, Pixelmon, Reforged, spawning, Pokémon, useExternalJSONFilesSpawning, custom, SpawnSet, SpawnInfo" metadescription="A page explaining the Better Spawner and its many options."/>
 
{{stub}}
 
The Better Spawner is an new entity spawning system introduced in Pixelmon 6.0.0. It is capable of handling item, Pixelmon NPC, and Pokémon spawning, but programmatically can be expanded to handle any kind of entity. All information on what entities spawn and where is backed by JSON files. These can be modified from, by default, <code>pixelmon/spawning/</code> if the Pixelmon Config has <code>useExternalJSONFilesSpawning</code> enabled. The directory the external JSONs will load from can be modified in the Pixelmon Config.
 
  
The central idea of the Better Spawning system revolves around <code>SpawnSet</code>s and <code>SpawnInfo</code>s.
+
The Better Spawner is a new entity spawning system introduced in Pixelmon 6.0.0 and the sole spawning system starting from Pixelmon 6.3.0. It is capable of handling item, Pixelmon NPC, and Pokémon spawning but can be expanded to handle any kind of entity. All information on what entities spawn and where is backed by JSON files. These can be modified from, by default, <code>pixelmon/spawning/</code> if the Pixelmon Config has <code>useExternalJSONFilesSpawning</code> enabled. The directory the external JSONs will load from, and many other performance-related options can be modified in the [[Config|Pixelmon config]]. The default options are recommended for singleplayer as well as multiplayer with fewer than 100 players.
  
A <code>SpawnInfo</code> represents the smallest component of spawning and is in essence information about a possible thing to spawn. As an example, there may be none or one or more <code>SpawnInfo</code>s that will spawn an Abra, each with a different rarity. One might make one <code>SpawnInfo</code> which is far rarer than the others, and spawns Abra at a much higher level. The possible properties of a <code>SpawnInfo</code> are as follows.
+
Many more options for the Better Spawner exist in the [[Better_Spawner/Config|Better Spawner config]].
  
{|class="wikitable"
+
Important components when modifying how things spawn:
!Property label
+
*[[Better_Spawner/Spawn_Set|SpawnSet]]
!Type of value
+
*[[Better_Spawner/Spawn_Info|SpawnInfo]]
!Description
 
|-
 
|style="text-align:center"|<code>"typeID"</code>
 
|style="text-align:center"|<code>"pokemon"</code> or <code>"npc"</code> or <code>"item"</code>
 
|style="text-align:center"|The type of <code>SpawnInfo</code> this is. Sidemods may add more types, in which case the number of possible values would increase.
 
|-
 
|style="text-align:center"|<code>"condition"</code>
 
|style="text-align:center"|A [[Better_Spawner/Spawn_Condition]].
 
|style="text-align:center"|The condition for the spawn location to fulfill that will allow the entity to spawn.
 
|-
 
|style="text-align:center"|<code>"anticondition"</code>
 
|style="text-align:center"|An optional [[Better_Spawner/Spawn_Condition]].
 
|style="text-align:center"|The anti-condition for the spawn location which must ''fail'' to allow the entity to spawn.
 
|-
 
|style="text-align:center"|<code>"requiredSpace"</code>
 
|style="text-align:center"|Optional positive integer, including 0.
 
|style="text-align:center"|The necessary radius of the location for this entity to spawn. Defaults to 1, minimum is 0. The radius is calculated based off how much of the surrounding area is free of colliding blocks. In the case of Pokémon spawning, leaving out this field will use a number based off the Pokémon's size.
 
|-
 
|style="text-align:center"|<code>"stringLocationTypes"</code>
 
|style="text-align:center"|List of any number of [[Better_Spawner/Location_Type|location types]] inside quotes.
 
|style="text-align:center"|The possible locations the entity may spawn. A location only needs to satisfy one of these to spawn, and in the case of Pokémon spawning, the AI of the Pokémon may depend on the location.
 
|-
 
|style="text-align:center"|<code>"rarity"</code>
 
|style="text-align:center"|Decimal number greater than or equal to zero.
 
|style="text-align:center"|The level of commonness for the entity. The higher this number is, the more frequently this entity will spawn. This is not a percentage and doesn't follow any rules. If all <code>SpawnInfo</code> tripled their rarities, nothing would change. With the default <code>SpawnSet</code>s, 0.5 is extremely rare, and 300 is extremely common. Having a rarity of zero will prevent it from spawning.
 
|}
 
 
 
Specific types of <code>SpawnInfo</code>s have extra properties.
 
 
 
For <code>"typeID" = "pokemon"</code>:
 
{|class="wikitable"
 
!Property label
 
!Type of value
 
!Description
 
|-
 
|style="text-align:center"|<code>"spec"</code>
 
|style="text-align:center"|A [[Pokémon Spec]] in its JSON form.
 
|style="text-align:center"|The [[Pokémon Spec]] representation of the Pokémon to spawn. This might just contain the name, or any other of the options.
 
|-
 
|style="text-align:center"|<code>"minLevel"</code>
 
|style="text-align:center"|Positive integer.
 
|style="text-align:center"|The lowest level the Pokémon may spawn at. This option is ignored if the [[Pokémon Spec]] option specifies the level.
 
|-
 
|style="text-align:center"|<code>"maxLevel"</code>
 
|style="text-align:center"|Positive integer.
 
|style="text-align:center"|The highest level the Pokémon may spawn at. This option is ignored if the [[Pokémon Spec]] option specifies the level.
 
|-
 
|style="text-align:center"|<code>"spawnSpecificShinyRate"</code>
 
|style="text-align:center"|Optional positive integer, including 0.
 
|style="text-align:center"|The shiny rate denominator specific to this spawn. For example, if one desired a 1% chance of a shiny for a spawn, this field would be <code>100</code> to represent a 1/100 chance.
 
|}
 
 
 
For <code>"typeID" = "npc"</code>:
 
{|class="wikitable"
 
!Property label
 
!Type of value
 
!Description
 
|-
 
|style="text-align:center"|<code>"npcType"</code>
 
|style="text-align:center"|Any of the following: <code>"Trainer"</code>,<code>"ChattingNPC"</code>,<code>"Relearner"</code>,<code>"Tutor"</code>,<code>"Trader"</code>,<code>"Shopkeeper"</code>,<code>"NurseJoy"</code>.
 
|style="text-align:center"|The type of NPC to spawn. The properties of the NPC will be generated automatically.
 
|}
 
* NPC spawning is likely to change to support much more specific properties.
 
 
 
 
 
For <code>"typeID" = "item"</code>:
 
{|class="wikitable"
 
!Property label
 
!Type of value
 
!Description
 
|-
 
|style="text-align:center"|<code>"itemID"</code>
 
|style="text-align:center"|Item ID, e.g. <code>"minecraft:string"</code>, <code>"pixelmon:rare_candy"</code>.
 
|style="text-align:center"|The ID of the item to spawn.
 
|-
 
|style="text-align:center"|<code>"minQuantity"</code>
 
|style="text-align:center"|Positive integer.
 
|style="text-align:center"|The smallest number of the item to spawn. If the same as maxQuantity, it will always spawn this amount.
 
|-
 
|style="text-align:center"|<code>"maxQuantity"</code>
 
|style="text-align:center"|Positive integer.
 
|style="text-align:center"|The smallest number of the item to spawn. If the same as minQuantity, it will always spawn this amount.
 
|-
 
|style="text-align:center"|<code>"meta"</code>
 
|style="text-align:center"|An optional integer
 
|style="text-align:center"|The meta value of the item. This is used to differentiate, for example, andesite and granite from simple stone.
 
|-
 
|style="text-align:center"|<code>"nbt"</code>
 
|style="text-align:center"|An optional NBT tag compound in JSON form.
 
|style="text-align:center"|Any NBT data for the item stack. This might contain display name, lore, enchantments, etc.
 
|}
 
 
 
A <code>SpawnSet</code> is a grouping of one or more <code>SpawnInfo</code>s along with a small number of properties.
 

Latest revision as of 09:28, 10 June 2020

The Better Spawner is a new entity spawning system introduced in Pixelmon 6.0.0 and the sole spawning system starting from Pixelmon 6.3.0. It is capable of handling item, Pixelmon NPC, and Pokémon spawning but can be expanded to handle any kind of entity. All information on what entities spawn and where is backed by JSON files. These can be modified from, by default, pixelmon/spawning/ if the Pixelmon Config has useExternalJSONFilesSpawning enabled. The directory the external JSONs will load from, and many other performance-related options can be modified in the Pixelmon config. The default options are recommended for singleplayer as well as multiplayer with fewer than 100 players.

Many more options for the Better Spawner exist in the Better Spawner config.

Important components when modifying how things spawn:

© 2012 - 2025 Pixelmon Mod