Chicken jockeys and mob spawning: false
Since minecraft 1.7.4 chicken jockeys can spawn naturally. Due to the fact that this is some kind of stacked entity (mob and animal) the chicken span isn't cancelled when a chicken jokey tries to spawn if spawn monsters is set to false which leads to an huge amount of chickens in an short time.....
How to reproduce it:
Config example:
difficulty: HARD
spawning:
==: MVSpawnSettings
animals:
==: MVSpawnSubSettings
spawn: 'true'
spawnrate: '-1'
exceptions: []
monsters:
==: MVSpawnSubSettings
spawn: 'false'
spawnrate: '-1'
exceptions: []
If you got to the nether (or normal world but its much easier to notice in the nether) chickens will start to spawn.
Some example code how to determine if the chicken is an chicken jockey chicken:
LivingEntity suspect = event.getEntity();
if(suspect instanceof Chicken)
{
List nearbyMobs = suspect.getNearbyEntities(0.5D, 1.0D, 0.5D);
Iterator nearbyMobIterator = nearbyMobs.iterator();
boolean foundZombie = false;
Entity result = null;
while(nearbyMobIterator.hasNext())
{
result = (Entity)nearbyMobIterator.next();
if((result instanceof Zombie) || (result instanceof PigZombie))
foundZombie = true;
}
if(foundZombie)
suspect.setRemoveWhenFarAway(true);
}
Try this: http://dev.bukkit.org/bukkit-plugins/chicken-jockey-fix/
https://bugs.mojang.com/browse/MC-42174 and https://bugs.mojang.com/browse/MC-44778 Should eventually be fixed :P
I know this plugin its an workaround but not an complete fix. If you use this plugin the chickens despawn after some time but don't stop them from spawing.
Look at the links, not one of them, mojang bugger up.
I think you don't understand my problem ;)
Here is a small guide hot to reproduce the problem:
1.) Get the latest bukkit (#3074) or spigot (#1453) build and the latest build of multiverse (#688) . 2.) Configure multiverse like the example above (difficulty hard and mob spawning false) 3.) Got to the nether world and wait some time.
Expected output: There should be not mobs or animals at all because mobs should not spawn (mob spawn settings) and animals don't spawn in the nether at all.
Real output: Chickens are spawning because if minecraft tries to spawn an chicken jockey only the spawn event of the baby zombie is canceled.
I hope this explanation helps ;)
Mojang bug, we set the mob spawning in a way they don't agree with (Apparently according to their bug list) It's the chicken jockey that's messing up, which is affiliated with mojang, not multiverse.
If you want we can spend the next hours discussing if this an mv problem or an mojang problem or an bukkit problem but this will not lead to any useful results ;).
It is a bug, not multiverse, Spigot fixed the bug that craftbukkit didn't bother fixing: http://ci.md-5.net/job/Spigot/1455/
... it was merged from upstream. aka bukkit fixed it, not spigot. https://github.com/Bukkit/CraftBukkit/commit/8356f65daa8e01bbb33b4c6345b6724ee991502b
Also can we close this issue, it keeps bumping up and annoying me as IMO it should never have been a multiverse issue, and the code proposed was more of a hack.
No sry this can't be closed because the problem still exists on bukkit #3075.
OK I'll make a pull request for this, but first can you test to see if spawn animals false still results in the chickens spawning? It is arguable that it is actually correct behaviour considering chickens are animals but I agree that they should be special cased as mobs if spawned as a zombie mount.
Thx. If i set animals to false no chickens are spawning.
Oh, and is there any reason why you arn't using /gamerule doMobSpawning False ?
It can improve performance as instead of the mobs spawning then dieing pretty much every tick, they just don't spawn in the first place.
I completely forgot about this ;). Thx for the tip I'll use /mv gamerule instead of the settings in the config now :)
The code surrounding the spawning smells a bit, there is no current way to get the reason why the mob was spawning, multiverse only cares about the entity type at current and I'm a little scared of contributing because multiverse seems so well laid out compared to other plugins.
I know......
The idea with the game rule fix the problem for me :)
The code surrounding the spawning smells a bit, there is no current way to get the reason why the mob was spawning, multiverse only cares about the entity type at current and I'm a little scared of contributing because multiverse seems so well laid out compared to other plugins.
Haha as if! There are so many things that should be done better (some of it is really bad) :/ I just don't really have the time right now. Feel free to contribute! @dumptruckman handles most of the patches nowadays and is working on the v3 version of MV.
So, I saw someone said this issue can be closed?
It's not fixed if you use the monster spawn settings in the config but you can use the per world gamerule (doMobSpawnig) to disable the mob spawning without the chicken problem so I'm not sure if it should be closed ..........
Just update bukkit... (Or use latest spigot) There you go, problem solved, why fix something when it's already fixed? No point.
Please don't say it is fixed if you haven't tested it.
I have tested it on the latesed version of bukkit/spigot and its NOT fixed at all.