记录类 StructureModifiers.AddSpawnsStructureModifier

java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.world.StructureModifiers.AddSpawnsStructureModifier
记录组件:
structures - Structures to add mob spawns to.
spawners - List of SpawnerDatas specifying EntityType, weight, and pack size.
所有已实现的接口:
StructureModifier
封闭类:
StructureModifiers

public static record StructureModifiers.AddSpawnsStructureModifier(HolderSet<Structure> structures, WeightedList<MobSpawnSettings.SpawnerData> spawners) extends Record implements StructureModifier

Stock structure modifier that adds a mob spawn override to a structure. If a structure has mob spawn overrides, random mob spawning will use the structure's spawns instead of the local biome's spawns. Has the following json format:

 {
   "type": "neoforge:add_spawns", // Required
   "structures": "#namespace:structure_tag", // Accepts a structure id, [list of structure ids], or #namespace:structure_tag
   "spawners":
   {
     "type": "namespace:entity_type", // Type of mob to spawn
     "weight": 100, // int, spawn weighting
     "minCount": 1, // int, minimum pack size
     "maxCount": 4, // int, maximum pack size
   }
 }
 

Optionally accepts a list of spawner objects instead of a single spawner:

 {
   "type": "neoforge:add_spawns", // Required
   "structure": "#namespace:structure_tag", // Accepts a structure id, [list of structure ids], or #namespace:structure_tag
   "spawners":
   [
     {
       "type": "namespace:entity_type", // Type of mob to spawn
       "weight": 100, // int, spawn weighting
       "minCount": 1, // int, minimum pack size
       "maxCount": 4, // int, maximum pack size
     },
     {
       // additional spawner object
     }
   ]
 }