Biome Spawners
Wyck provides a built-in system for customizing mob spawns inside custom biomes. MobSpawnSettings, set through the
NATURAL_MOB_SPAWNS environment attribute, inform the server what mobs to spawn, how many, how likely, and how many concurrently can spawn.
Example Usage
Section titled “Example Usage”import dev.wyck.biome.CustomBiome;
import dev.wyck.keys.ResourceKey;
import dev.wyck.biome.entity.MobSpawnSettings;
import dev.wyck.environment.attribute.EnvironmentAttributes;
import org.bukkit.entity.EntityType;
import org.bukkit.plugin.java.JavaPlugin;
public class ExamplePlugin extends JavaPlugin {
@Override
public void onEnable() {
// A biome that will only ever spawn large quantities of pigs.
MobSpawnSettings spawner = MobSpawnSettings.builder()
.addSpawn(EntityType.PIG, 100, 4, 12)
.build();
CustomBiome.builder()
.resourceKey(ResourceKey.of("test", "custombiome"))
.waterColor("#F5F2EB")
.grassColor("#DBE9EC")
.attribute(EnvironmentAttributes.NATURAL_MOB_SPAWNS, spawner)
.register();
}
} import dev.wyck.biome.CustomBiome;
import dev.wyck.keys.ResourceKey;
import dev.wyck.biome.entity.MobSpawnSettings;
import dev.wyck.environment.attribute.EnvironmentAttributes;
import org.bukkit.entity.EntityType;
import org.bukkit.plugin.java.JavaPlugin;
public class ExamplePlugin extends JavaPlugin {
@Override
public void onEnable() {
// A biome that will spawn no mobs.
MobSpawnSettings spawner = MobSpawnSettings.NO_SPAWNS;
CustomBiome.builder()
.resourceKey(ResourceKey.of("test", "custombiome"))
.waterColor("#F5F2EB")
.grassColor("#DBE9EC")
.attribute(EnvironmentAttributes.NATURAL_MOB_SPAWNS, spawner)
.register();
}
} Mob Spawn Costs
Section titled “Mob Spawn Costs”Setting charge lower and energyBudget higher allows more of a specific mob to spawn concurrently.
Example Usage
Section titled “Example Usage”import dev.wyck.biome.CustomBiome;
import dev.wyck.keys.ResourceKey;
import dev.wyck.biome.entity.MobSpawnSettings;
import dev.wyck.environment.attribute.EnvironmentAttributes;
import org.bukkit.entity.EntityType;
import org.bukkit.plugin.java.JavaPlugin;
public class ExamplePlugin extends JavaPlugin {
@Override
public void onEnable() {
MobSpawnSettings spawner = MobSpawnSettings.builder()
.addSpawn(EntityType.PIG, 100, 4, 12)
.addSpawn(EntityType.COW, 100, 4, 12)
// Allows cows to spawn faster in this biome.
.addMobSpawnCost(EntityType.COW, 25, 100)
.build();
CustomBiome.builder()
.resourceKey(ResourceKey.of("test", "custombiome"))
.waterColor("#F5F2EB")
.grassColor("#DBE9EC")
.attribute(EnvironmentAttributes.NATURAL_MOB_SPAWNS, spawner)
.register();
}
}