Class StructureSpawnManager

java.lang.Object
net.minecraftforge.common.world.StructureSpawnManager

public class StructureSpawnManager extends Object
Class to help manage entity spawns inside of structures
  • Field Details

  • Constructor Details

    • StructureSpawnManager

      public StructureSpawnManager()
  • Method Details

    • gatherEntitySpawns

      public static void gatherEntitySpawns()
      Gathers potential entity spawns for all the different registered structures.
    • gatherEntitySpawns

      private static void gatherEntitySpawns(Map<Structure<?>,StructureSpawnManager.StructureSpawnInfo> structuresWithSpawns, Structure<?> structure)
    • getStructureSpawns

      @Nullable public static List<MobSpawnInfo.Spawners> getStructureSpawns(StructureManager structureManager, EntityClassification classification, BlockPos pos)
      Looks up if a given position is within a structure and returns any entity spawns that structure has for the given classification, or null if none are found.
      Parameters:
      structureManager - Structure Manager, used to check if a position is within a structure.
      classification - Entity classification
      pos - Position to get entity spawns of
    • getSpawnList

      public static List<MobSpawnInfo.Spawners> getSpawnList(Structure<?> structure, EntityClassification classification)
      Gets the entity spawn lists for entities of a given classification for a given structure.
      Parameters:
      structure - The Structure
      classification - The classification to lookup