At the moment you just cancel the spawn events of mobs/animals to control mob/animal spawning. A much better way is to use setSpawnFlags(boolean allowMonsters, boolean allowAnimals) to disable/enable monster and animals pawning.
This will also fix #1424 in an better way. The gamerule doMobSpawning prevents all mobs (animals and monsters) from spawning.
At the moment you just cancel the spawn events of mobs/animals to control mob/animal spawning. A much better way is to use setSpawnFlags(boolean allowMonsters, boolean allowAnimals) to disable/enable monster and animals pawning.
This will also fix #1424 in an better way. The gamerule doMobSpawning prevents all mobs (animals and monsters) from spawning.