Mob Stages
Mob Stages is an extension for the GameStage API that enables the integration of mob spawning into a custom progression system. For a more comprehensive understanding, it is recommended to review the description of the GameStage API mod. In brief, stages are components of the progression system configured in modpacks or on servers. Players gain access to stages through commands, typically triggered by quest mods, advancements, or command blocks.
Setup
Configuration of the mod is handled through CraftTweaker.
Basic Setup
mods.MobStages.addStage(String stage, String entityId);— adds a mob to a specific stage. When attempting to spawn in the world, it checks for nearby players with the unlocked stage. If no such players are found, the mob will not spawn.mods.MobStages.addReplacement(String entityId, String replacementId);— sets a replacement for the mob. If it cannot spawn, the replacement mob will be created instead. Requires the mob to be added to a stage first. Optional.mods.MobStages.addRange(String entityId, int range);— sets the search radius for players. The default radius is 256 and is set automatically. Optional.mods.MobStages.toggleSpawners(String entityId, boolean allow);— allows mob spawners to ignore stage rules and spawn the mob regardless.
Dimensional Setup
The mod provides versions of all methods from the previous section that account for dimensions. In dimensional versions, methods accept a numerical dimension ID as the last parameter. For example, mods.MobStages.addStage(String stage, String entityId); becomes mods.MobStages.addStage(String stage, String entityId, int dimension);. If a mob has a dimensional entry, it overrides the global entry.
Example Script
// Creepers require stage one to spawn
mods.MobStages.addStage("one", "minecraft:creeper");
// Skeletons require stage two, or any spawner.
mods.MobStages.addStage("two", "minecraft:skeleton");
mods.MobStages.toggleSpawner("minecraft:skeleton", true);
// Spiders require stage three in the nether.
mods.MobStages.addStage("three", "minecraft:spider", -1);
// Zombies
mods.MobStages.addStage("four", "minecraft:zombie", -1);
mods.MobStages.toggleSpawner("minecraft:zombie", true, -1);
// Zombies are replaced by bats in other dimensions.
mods.MobStages.addStage("four", "minecraft:zombie");
mods.MobStages.addReplacement("minecraft:zombie", "minecraft:bat");