Multiverse-Core icon indicating copy to clipboard operation
Multiverse-Core copied to clipboard

Chicken jockeys and mob spawning: false

Open MarioG1 opened this issue 12 years ago • 25 comments

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);
        }

MarioG1 avatar Apr 12 '14 22:04 MarioG1

Try this: http://dev.bukkit.org/bukkit-plugins/chicken-jockey-fix/

FlippantCactus avatar Apr 27 '14 12:04 FlippantCactus

https://bugs.mojang.com/browse/MC-42174 and https://bugs.mojang.com/browse/MC-44778 Should eventually be fixed :P

FlippantCactus avatar Apr 27 '14 16:04 FlippantCactus

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.

MarioG1 avatar Apr 27 '14 17:04 MarioG1

Look at the links, not one of them, mojang bugger up.

FlippantCactus avatar Apr 28 '14 19:04 FlippantCactus

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 ;)

MarioG1 avatar Apr 29 '14 17:04 MarioG1

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.

FlippantCactus avatar Apr 29 '14 18:04 FlippantCactus

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 ;).

MarioG1 avatar Apr 29 '14 18:04 MarioG1

It is a bug, not multiverse, Spigot fixed the bug that craftbukkit didn't bother fixing: http://ci.md-5.net/job/Spigot/1455/

FlippantCactus avatar Apr 30 '14 19:04 FlippantCactus

... 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.

ryantheleach avatar Apr 30 '14 19:04 ryantheleach

No sry this can't be closed because the problem still exists on bukkit #3075.

MarioG1 avatar Apr 30 '14 19:04 MarioG1

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.

ryantheleach avatar Apr 30 '14 19:04 ryantheleach

Thx. If i set animals to false no chickens are spawning.

MarioG1 avatar Apr 30 '14 19:04 MarioG1

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.

ryantheleach avatar Apr 30 '14 19:04 ryantheleach

I completely forgot about this ;). Thx for the tip I'll use /mv gamerule instead of the settings in the config now :)

MarioG1 avatar Apr 30 '14 19:04 MarioG1

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.

ryantheleach avatar Apr 30 '14 20:04 ryantheleach

I know......

The idea with the game rule fix the problem for me :)

MarioG1 avatar Apr 30 '14 20:04 MarioG1

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?

fernferret avatar Apr 30 '14 22:04 fernferret

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 ..........

MarioG1 avatar Apr 30 '14 22:04 MarioG1

Just update bukkit... (Or use latest spigot) There you go, problem solved, why fix something when it's already fixed? No point.

FlippantCactus avatar May 01 '14 06:05 FlippantCactus

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.

MarioG1 avatar May 01 '14 09:05 MarioG1