bukkit Spawning Rules


Example

There are some spawning rules in Worlds in Bukkit. They are:

  • Animal Spawning
  • Creature Spawning
  • Amount of the above that can be spawned


Animal Spawning


Animal spawning can be split into the following categories:

  • Water Animals
  • Land Animals

To get the amount of animals that can be spawned inside the World at runtime, you can use the method

int getAnimalSpawnLimit()

For land animals and

int getWaterAnimalSpawnLimit();

For water animals.

Both limits can be set with the methods

void setAnimalSpawnLimit(int limit);
void setWaterAnimalSpawnLimit(int limit);

Note: If set to numbers below 0, world's default amount will be used instead.

Minecraft makes an attempt to spawn animals every 400 ticks (default). That can be changed if you desire, using the following signatures:

void setTicksPerAnimalSpawns(int ticks);
void setTicksPerWaterAnimalSpawns(int ticks);
  • A value of 1 will mean the server will attempt to spawn animals in this world every tick.
  • A value of 400 will mean the server will attempt to spawn animals in this world every 400th tick.
  • A value below 0 will be reset back to Minecraft's default.

Note: If set to 0, animal spawning will be disabled for this world. It's recommended to use setSpawnFlags(boolean, boolean) to control this instead.