- Joined
- Apr 20, 2014
- Messages
- 63
- Reaction score
- 119
- Points
- 0
- Location
- Between the frosting and the plate.
Vanilla Mob Spawning, MassiveMob Spawning, Mob Caps, and Chunk info on Massive[Research/Help]
(pssstttt...it's not organized in this Order)
(pssstttt...it's not organized in this Order)
How exactly does mob spawning work in Minecraft(Multi-player and Single player), could the multiple plugins on MassiveCraft(such as factions, massive-mobs, potions, etc)effect mob spawning and spawn rates? How often and where will mobs spawn, and why?
These are questions that have been running through my head for a while now. And Since I was unable to find any information on the topic, or anything that may anwser my questions, I decided to do some research as well as experiment with the multitude of mobs as such.
Vanilla Spawning
I began said research by looking at the spawning system for Pure Vanilla Minecraft(Vanilla meaning that there are no mods or plugins). And found that , In the words of the Minecraft Wiki, /Mobs are broadly divided into four categories: Hostile, Friendly, Water(i.e. Squid), and Ambient(i.e. Bat)./ which I for one, did not know, -I believed that mobs where categorized into Peaceful, and Hostile Categories, and there then where the bats, which in my opinion at the time, where just annoyances. So from there, after discovering these categories, I began testing the spawning rates of said mobs, and found that Hostile Mobs have one spawning cycle once every game tick(1/20th of a second), whiled friendly and water categorized mobs only went through one spawning cycle every 400 Game ticks(20 seconds). Because of this I concurred that Hostile mobs can spawn at any time, while Freindly mobs very rarely spawn, normally going through their main cycle when a new chunk is loaded for the first time. At first I thought this was all there was to mob spawning, but I was completely wrong.
You see, Mobs spawn naturally inside a Loaded Square chunk group. In single player mode, this area would be a 15x15 chunk area(240 Blocks* 240 Blocks), But on multiplayer servers the size varies with the server settings. When there are multiple players, mobs can spawn within the given distance(240 Blocks) of any of them. However, hostile mobs(and some others) that mover farther than 128 blocks from any player will soon despawn, so even within a larger chunk loading radius, the mob spawning is more-or-less limited to spheres with a radius of 128 blocks, centered upon each and every player. But this is where the MassiveFactions plugin may come in, you can set flags for your faction that make it where no mobs may spawn within your claimed chunks. So if you're standing in your claimed chunk, and there are claimed chunks occupying every chunk in the 128 block radius around you, nothing at all will spawn within or around your chunks, causing them instead to spawn in any unclaimed chunk that is near another player. But also in turn completely skipping that areas spawn cycle.
Mob Capacity(Cap)
Mob caps are directly porportional to the total number of chunks elligable for spawning(Claiming and setting Mob Spawning to false lowers the max cap because it makes the chunk inelligable for spawning, the same goes for excessive lighting). To calculate the cap, the spawning area is expanded by one chunk in every direction(so the default gives 17x17 chunks), then the total number of chunks is Plugged into the following Formula
Cap = constant*chunks/256
Each mob category has a different cap and a different constant in he formula:
- Hostile = 70
- Friendly = 10
- Ambient = 15
- Water = 5
In single player mode, the chunk count is 17x17=289, and the cap works itself out to be:
- Hostile = 79
- Friendly = 11
- Ambient = 16
- Water = 5
In multiplayer however, chunks that are in the range of multiple players are only counted once(So in turn, this would mean dark-rooming[DR] alone is far more productive). So the more spread out the players are, the more chunks will be covered and the higher caps will be, but if thousands of chunks are in-elligable due to lighting or claiming, then the cap severely decreases. The caps themselves are checked once at the beginning of each spawning cycle. If the number of living mobs in a category is at its cap, the entire spawning cycle for that category will be skipped.
Pack Spawning
For each spawning cycle, one attempt is made to spawn a pack of mobs in each eligible chunk. A random location in the chunk is chosen to be the center point of the pack. For the pack to spawn at all, the center block must be water for water mobs and air for all other mobs. Note that in the latter case, it must actually be an air block. Any other block, even a non-colliding one, will prevent the entire pack from spawning.
If the pack location is suitable, 12 attempts are made to spawn up to 4 mobs (8 for Wolves, 1 for Ghasts) within a 41×1×41 area centered at that block (that's a 41×41 square that is one block high). Mobs will spawn with the lowest part of their body inside this area. For each spawn attempt, a block location within the pack area is chosen at random. Though the pack area extends 21 blocks out from the center, the random location is heavily skewed toward the center of the pack. Approximately 85% of spawns will be within 5 blocks of the pack center, and 99% within 10 blocks of the center.
All mobs within a pack are the same species. The species for the entire pack is chosen randomly from those eligible to spawn at the location of the first spawn attempt in the pack.
In the Overworld, this depends on the biome:
- Most biomes can spawn sheep, pigs, chickens, cows, spiders, zombies, skeletons, creepers, Endermen, witches, and Squid.
- Forest and taiga biomes can also spawn Wolves.
- Jungle biomes can also spawn Ocelots.
- Desert, beach, river, and ocean biomes cannot spawn animals; only hostile mobs and Squid.
- There are actually two ways for a Slime to naturally spawn without a Monster Spawner: In any eligible chunk under layer 40, or in a swamp biome at a low light level
- There must be no players and no player spawn points within a 24 block distance (spherical) of the spawning block
- If it's a squid, then...
- the spawning block must contain liquid (water or lava)
- the spawning block must be between level 46 through 62, inclusive
- the spawning mob must not be obstructed by other mobs
- If it's not a squid, then...
- the block directly below it must have a solid top surface (opaque, upside down slabs / stairs and others)
- the block directly below can't be bedrock
- the spawning block itself must be non-opaque and non-liquid
- the block directly above it must be non-opaque
- the spawning mob hit-box must not be obstructed by solid blocks, other mobs or liquids
- If it's an animal, then...
- the block directly below the spawning block must be grass
- the light level of the spawning block must be 9 or brighter
- if it's an ocelot, then...
- the spawning block must be above level 62
- the block directly below the spawning block must be grass or leaves
- there is a 1/3 chance the spawn will fail
- If it's a hostile mob in the overworld, then...
- the light level of the spawning block must be 7 or darker, and more light increases the chance that the spawn will fail
- sunlight falling on the spawning block further increases the chance that the spawn will fail, by up to 50%
MassiveMob Spawning
MassiveMobs is a server side plugin that makes use of a few vanilla aspects of the game, these being that mobs holding items possess a longer despawn time unless the square chunk group that mob is in becomes unloaded(examples being Dropped player items, Leads, Name Tags, Golden tools, books, etc.), and mobs that are named(Normally with a a name tag if not in creative or using cmd blocks) will not despawn(The plugin however has it set that some mobs will despawn based upon in-game ticks, it varying for each massivemob), this being possible because the game packets(The groupings of Java code that make up the Game) recognize said mob not as an entity, like other mobs, but as what I like to call, a Packet Pen(the reason for this being that if you think about it, a pen can move anywhere on a piece of paper and write or change things, make markings, etc. The players in game do the same thing by moving around the packets, the things that make up the world, and editing them, or writing on them like they're a pen). But they are also know by other....more intelligent people, such as yourselves, as Players. And players, as you all know, can't despawn like entities or mobs.
So the plugin code is written to give "names" to certain mobs, and then buff them up with higher health, higher attack; and Special, permanent effects such as regeneration, strength, invisibility, or speed. It then proceeds to find a suitable, eligible spawn location and begins placing the codes that make up that Mob into the packets. Some exceptions of this Eligibility system are the Slime ancient and the Magma Ancient, both extremely powerful Mobs/bosses that deal insane damage and have insane health and effects. These can both spawn Daylight and Have been coded to output speech lines within the chat console. They However, are extremely rare, about a 15% chance for a Slime Ancient, and a 5% chance for a Magma Ancient to spawn every 100 spawning cycles.
Some variants of the MassiveMobs such as the Cultists(Normally Zombies in White or Black Leather Armour), and the Spiders also make use of the pack spawning system I outlined earlier as well as impliment the spawning location requirements, such as the Light Level, the Player Proximity, and the Opaque/Non-Opaque block, code strand.
There is are also mobs that drop Entities that are based upon their Titles, two examples being the Pastry Chef(Drops Cookies[Normally 16], 1-3 Cakes, and 3 Pumpkin Pie), and the Undead Jeweller(Drops Emeralds, Diamonds, clocks, and Gold).
Sometimes there will be an extra word in front of the Name of the mob, for example: Withering Undead Cultist. This word is used to describe the effect the mob will have if they land a successful hit on you. I'd Link you a proper list of effects if there was a Location where they where all located, but there ins't at this time, so I will try my best to list all of the ones I know, as well as describe them the bst I can without sounding completely idiotic. Also, please feel free to correct my effect durations and to add/remove any effects you know can come on massivemobs
Withering: You're struck with the force of the Wither, it's essensce seeping into your body and damaging you like the worst poison imaginable.
Wither, 15 seconds
Slowing: Your feet begin to feel heavy mere seconds after your foe lands hid blow, you move like a slug and you swing like a child for mere seconds, and then suddenly, everything goes fast forward as the effect wears off.
Slowness, 10 Seconds
Dazing: You suddenly grow dizzy as your foe slams its fist into the side of your helm, leaving you standing still, staring into nothingness as you become solid, unable to move as your foe draws near, then suddenly, you are no longer dizzy and can move again!
Dazed, 8 Seconds....?
Poisonous: You scream as the corrosive poison splashes your armour and eats through to your flesh, and then as it wears off and the pain dies, you resume your slaughter of the spider filth.
Poison, 10 seconds
Weakening: The dart slams into your leg and empties its venoms into your bloodstream, leaving you as strong as a child hefting his first sword, dealing little damage to the foes that you where just crushing. But It lasts only a little while, and you resume your smiteful quest.
Weakness, 10 seconds
Hungering: Your mouth begins to water as your sustenance slowly begins to fade, leaving you starving, slow, and weak.
Hunger, 20 seconds
In the words of @yendor46, "MassiveMobs are enabled in Fendarfell and Daendroc. Fendarfell is the only world on s3. Daendroc and Ellador are on s4. Fendarfell is the most challenging world for mob spawning, as there are few caves in which mobs can stay during the day, so most hostile mobs die during the day and need to be respawned at night. This keeps a fairly constant load on the server." But they're also enabled in New Ceardia(NC, s2).
Sources:
http://minecraft.gamepedia.com/Minecraft_Wiki
http://forums.massivecraft.com/threads/darkroom-debate.10781/
Personal Testing
Server Experience
Thanks for reading, I hope this research helps you, as much as it's helped me!