Class SpawnSettings.SpawnDensity

java.lang.Object
net.minecraft.world.biome.SpawnSettings.SpawnDensity
Enclosing class:
SpawnSettings

public static class SpawnSettings.SpawnDensity
extends Object
Embodies the density limit information of a type of entity in entity spawning logic. The density field is generated for all entities spawned than a specific type of entity.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<SpawnSettings.SpawnDensity> CODEC
    • gravityLimit

      private final double gravityLimit
    • mass

      private final double mass
  • Constructor Details

    • SpawnDensity

      private SpawnDensity​(double gravityLimit, double mass)
  • Method Details

    • getGravityLimit

      public double getGravityLimit()
      Represents the cap of gravity as in GravityField.calculate(BlockPos, double) for entity spawning. If the cap is exceeded, the entity spawning attempt will skip.
    • getMass

      public double getMass()
      Represents the mass of each entity spawned. Will affect gravity calculation.