Fix note
Fix note: This has only been fixed for wolves as they spawn as friendlies. Ocelots spawn as monsters (i.e. continously) and need to be despawned when inactive.
I created a survival file and started playing. I found some wolves and caged them so they didn't run off until I got some bones. I did not tame them, and for some reason, after unloading the chunk, they disappeared.
To reproduce:
Create a new world with no generation modifications.
Find some wolves and trap them. Make note of their location.
Wander off until the chunk is no longer loaded (>16 chunks).
Go back and the wolves should've despawned.
the code affected
Related issues
is duplicated by
Comments


Can confirm that this is occurring in 1.6.4 unmodified singleplayer survival.
Untamed wolves follow passive mob spawning behavior (spawn with the world, do not spawn again unless the player commits genocide against all passive mobs in a large area and on a very slow cooldown), but follow hostile mob despawning behavior (disappear from loaded chunks when a suitable distance from the player after a decent length of time).
Wolves are, as a result, ridiculously difficult to find, since they need either excessively complex mob-farming, or require the player to tame the wolves shortly after loading their chunks.

I can confirm that wolves disappear after creating a new world and not taming them.
also they are very rare to find them at 1.7.2

Is this still a concern in the current Minecraft version 1.7.4 / Launcher version 1.3.7 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

I can confirm that in 1.7.4 untamed or Passive wolves do despawn.
In vanilla SMP I leaded and moved 4 wolves 1000 blocks to my pet shop where they can be distributed to players for them to tame. After moving away and unloading the chunk and returning, the wolves had despawned.

I'm playing snapshot 14w11b, and this is definitely still happening. Very frustrating!
I started a new game hoping to find some wolves, and luckily spawned in a taiga biome with wolves nearby. But by the time I had gotten bones (several game days later), I couldn't find the wolves again. Frustrated, I decided to re-create the world and try again. I've now started this world five times and each time the wolves despawn. After the first time I had the idea to punch out pits under each wolf I found so they couldn't escape while I was getting bones. But the pack was spread out enough that by the time I'd created three pits with two wolves in each, when I went back to the first pit, one of the wolves was gone. I went back to the second and third pits and all the wolves are gone! 😞 It was barely night time on the first day yet. Now all the wolves in this biome are gone, even though I took the trouble to keep them from running away. It's obvious they're despawning, just like hostile mobs. (And no, they weren't hostile to me. I carefully never punched any of them & never heard any growling.)
Try it for yourself. I used this seed: 6056175680782728351 and spawned in a taiga biome, there are some wolves to the north and east (about 6-8 of them, spread out a bit across the biome, just follow the barking). Try trapping them in pits or with walls, then wander a ways away gathering supplies to survive. If you went far enough away for hostile mobs to despawn, when you come back some or all of your trapped wolves will be missing. Poof, gone!
This is just ridiculous. I've only been playing for a few months, so not very experienced at combat etc, and it seems like for me tamed wolves are basically unobtainable. The only way I can think to work around this bug and get them, is to build a little hut with a door around the wolves the minute I find them, then punch nearby trees and build a few wooden swords and try to survive the night while staying very close outside the hut, hopefully killing enough skeletons to tame the wolves by morning. And hopefully not getting hut, wolves and all, blown up by a creeper. This doesn't sound like a very good plan... But thanks to this bug it's the only way I can think of to get tamed wolves. Please fix it? 😞

Still present in 14w26c
As the world generator was changed, I had to find a new seed/coordinate set.
Seed: 2315802128743922343
Coordinates: 200 73 -254
Still Present in 14w21b.
Just ran into this in 14w20a.
Seed: -6251828055016170649There are some wolves that spawn around 124 64 237.
I really like having tamed wolves, so I penned some off and planned to come back and tame them later. I hadn't been in this seed more than 30 minutes when they despawned. Going to check and see if they have to be out of sight or not.
Update: They seem to hang around if you're standing right next to them. I penned a few up and then sat at the edge of the Debug menu's entity detection range, and at that range they seem to despawn in a minute or less. This holds true even if you have line of sight to the wolves.

You mean they're not supposed to despawn if they're in an unloaded chunk? Yeah, it's happening for me, too, in 14w21a. However, they seem to stick around if you name them. (IDK if you're supposed to be able to name untamed wolves.) The same problem and solution occurs with untamed ocelots.

I encountered the same issue with wolves despawning. I had explored a large chunk of connecting mega, cold and normal tagais only to return there later to find 0 wolves. Ridicilous amount of pigs though.
Please make it so that wolves don't despawn. There must be some time allowed to gather bones without the wolves despawning on you. Have them trek around large distances but not despawning.
This happened to me in 1.7.9

Do you know that mobs despawn if you get out of the chunks where they are? Jeez!

Er, Franz, do you know what you are talking about?
Hostile mobs will despawn, but passive mobs shoudln't. If cows, pigs etc despawned when you left them, farming would not be possible.
Why should wolves need to be tamed or named to remain in existence, when other passive animals don't?

Still present in 14w28b. 😞
The mistake I made was using /tp instead of running. I don't know why they persist longer if you teleport out.
Can't seem to replicate in 14w28b! Can anyone else still replicate?
Still present in 14w28a.
Wolves an ocelots seem to hang on a little bit longer than before (could just be my imagination) but they still despawn.
Still present in 14w27b.
With the introduction of bunnies, the old seed/co-ordinate set has been outdated again.
Seed: 305903275254912669
Coordinates: 3062 78 2992

Untamed wolves despawning seems to also affect 14w27b.

Yes it just happened to me again in 14w28b. Started a new world with seed 8176374758187876152 - two wolves right next to spawn point. After they killed the local sheep I dug 2 block deep pits to push them into, then ran over 128 blocks away. Came back and the wolves had disappeared. Just a lonely dirt block entity floating in each pit. 😉
Hope they fix this before releasing 1.8. The mega taiga biome looks really cool with all the moss and podzol tho... would be even cooler if the wolves wouldn't disappear.

Morrison, why they don't despawn with tp is because the chunk gets unloaded and the mobs freeze in place so they are still there when you tp back.
when you run they get into the despawn within 30 seconds after a 30 second threshold for hostile mobs despawning rules.

Still present in 1.8.1-pre2

MC-696 technically describes this issue in its description, though it appears secondary based on where the comments headed. Perhaps a Relates to link. Or, even better, just change the description of MC-696 to remove this issue reference. I think it helps discussion (and probably fix rate) if each ticket is as monolithic as possible.

Is this really hard to fix? I hate passing through forests while exploring and leaving behind all those wolves that will be gone by the next time I visit.

SR - I don't know if it's hard to fix or not, but given it's not a "showstopper" bug my guess is that it's hard to prioritize fixing this particular bug over something else.
This bug did actually get an assignee though, which is a good sign. Plus, I'll be sure to keep updating the affected version until it finally makes it's way to the top of the pile!

The irony is that mobs are major pillars of the game, so the fact that 2 whole mobs are rendered useless unless you have the right materials the first time you see them is in fact pretty major. If you add the improper rendering of horse foals (MC-61535) (also see MC-62041 for more horse issues), that makes 3 mobs that are broken going into a major release.
If you don't think Mojang cares about mobs, then why would they add rabbits?

I agree, it probably isn't a priority right now but it should be with 1.8 coming out, since mobs are indeed a big part of the game.
Come to think of it, rabbits are pretty broken too, but that's another story.
I thought they would fix the most gamebreaking mob and boat bugs before 1.8, but it seems unlikely since they are getting ready to release it now.

Rabbits are now nearly flawless because they removed taming. The only hiccup is that rabbits won't begin breeding until after you switch your held item away from carrots.

I think it's because wolves and ocelots despawn like bats, squids, and hostile mobs. Though I do know they used to not despawn, and maybe that caused some confusion for you? The best thing to do is if you don't have enough items to tame them is to cage them, and then tame tag them.

Name tag them in survival? If you have name tags to throw around you've probably been playing a while and have already explored the nearby forests (thus causing nearby wolves to despawn); and if it's a newer world who has name tags for stuff like that? Plus these days we use our name tags for the charged creeper farm. Those things are valuable.
Less expensive to collect a stack of bones and go out exploring.
It will be awesome if this gets fixed, imagine living near a forest and having to protect your sheep from wild wolves... lol. I expect they won't work on this until after official 1.8 release though. Cause they have to fix any remaining crashes first.
@Jonathan, yeah it sure is nice that my rabbits won't teleport into cactus anymore!

Might be related to MC-23320.

When I take a look at the decompiled EntityWolf file using MCP 9.03, there is a canDespawn method. This method will return true if the entity is not tamed and 2400 ticks have elapsed.
Can somebody please confirm?
(not sure if this helps or not)

Still present in 1.8.1.

Well then again, ocelots are actually encoded into the game to be hostile mobs, just not attacking ones. Also, wolves are neutral like endermen, which also despawn. But since it now has an Assignee maybe it wasn't intended after all.

@Larry Blackburn :
Very interesting. It seems there is something missing in the code then.
Either Mojang need to allow them to spawn (just like squids or ocelots) and despawn, or delete that canDespawn thing (like farm animals).

Still in 1.8.2 pre 4

Using 1.8.1 Vanilla
Create a flat world creative world
Spawn two wolves (with eggs)
Use leash and tie one to a fence post
Leave the other to roam freely
Travel > 16 chunks away
Return after a little while
Both wolves have gone and the leash will be on the floor.
WIthout instantly taming wolves there is no way to keep the around.

Why isn't this a dupe of MC-23320?


Still present in 1.8.2-pre6.

@Sonic
Untamed wolves and ocelots are passive mobs. (At least they spawn like passive mobs.)

It seems that sometime around 1.0.0 the check for allowing wolves to despawn was changed from "is tamed" to "is angry", which probably caused MC-1407. Then in 1.5.2 it was changed to "is angry and not tamed", which seems good.
But then in 1.6.1 it changed to "is not tamed and loaded more than 2 minutes" for some reason, which is the code that Larry Blackburn identified above.
Ocelots, meanwhile, have despawned when not tamed since 1.2.2, and in 1.6.1 it was changed to "is not tamed and loaded more than 2 minutes" (I haven't checked what went on in the 1.6 development versions). In light of this, I suspect someone made the change for ocelots, saw similar code in wolves, and didn't realize that what makes sense for one doesn't for the other.
This makes sense for Ocelots, since they are in the hostile mob spawn list for jungles so they'll respawn frequently. But as long as wolves are in the passive mob spawn list for the biomes they spawn in, it doesn't make sense for them and should probably be changed back to only allowing despawning when angry and not tamed (and keep the 2-minute delay if you want).

Did the mods abandon this? It's not so much a bug as much as it is a faulty game mechanic that's gone unfixed for two years. I can't find any wolves on my world at all. Can we get a fix on this for those of us who don't know how to decompile and alter code?

I agree. This bug makes wolves effectively unusable. I found some wolves once, but I didn't have any bones on me at the time. Now I have no wolves in my world.
Why is this not a higher priority than any of the minor bugs that have been fixed over the last few months?

Politics. New users demand new features more strongly than loyal old users insist on fixing the game as it is.
Money. New features rake in new users, loyal users be damned. New features take a lot more time and effort than fixing ingrained bugs, and they take priority over fixing easy, small bugs.
Polish is likely not a priority for Mojang, and especially not Microsoft. They care most about a steady influx of new game purchases, whether that is PC or mobile or console. Also note https://twitter.com/jeb_/status/584465302991273986. Platform parity is a lot of work, and will probably just cause more bugs in the meantime.

Politics. New users demand new features more strongly than loyal old users insist on fixing the game as it is.
Money. New features rake in new users, loyal users be damned. New features take a lot more time and effort than fixing ingrained bugs, and they take priority over fixing easy, small bugs.
I don't think these bugs will attract new players either 😛

You really think a significant number of people decided NOT to purchase Minecraft just because wolves don't work as they should? The 4 people who did that will be completely drowned out by the masses who buy it when they hear about 1.9's combat updates.

But my point is, why are they focusing their resources on things like, "MC-3885 – Arrows shot into the underside of a block appear black," an issue which is, at worst, slightly annoying, instead of focusing on issues that entirely break a complete game feature?

They focus on the bugs that are easy to fix. That way they can claim "We're not ignoring you. Look, we fixed 50 bugs last update" without having to put too much time into it.

That's the root of my frustration, Tristan. These comments will likely get deleted by a mod, but I don't see why they don't have a "polish" team. There's probably reluctance to expand much within the Mojang gang, regarding efficiency as something that belongs in an economics class. Maybe the renewed traffic on this discussion will attract the assignee's attention; I don't know.
In the meantime I suggest packing up on bones and doing some good ole exploring to load some new chunks. That's the only "kosher" solution as of now. I spent the last few hours doing this (my world is mostly savanna and desert), and my heart skipped a beat upon actually finding some wolves. I spammed my 30+ bones and got four wolves for good measure.
Edit: And King, this problem should be relatively easy to fix. I got the impression that they would just have to tamper with the "canDespawn" part of the code for passive wolves. The reason it's been two years is that technically this mechanic "works as intended" but is not viable for most situations. Like a comment above says, it makes sense for ocelots but not for wolves.

Well, it's clearly not that simple. There are many bugs about entities disappearing when they shouldn't, there must be some deeper problem in the code. And no, it's not technically works as intended, it's still unresolved.

This is the code:
protected boolean canDespawn()
{
return !this.isTamed() && this.ticksExisted > 2400;
}
from this forum
I'm no programmer, but that looks like a simple fix. And yes, there are bugs like that, but they are usually unintentional side effects caused by the addition of new content. This appears to my untrained eye to be intentional coding. Also http://minecraft.gamepedia.com/Wolf lists this as a change made in 1.6.1, convincing me further that this is an intentional, albeit faulty, aspect of the wolves' spawning and despawning patterns.
Edit: Please read Larry Blackburn's and Anomie X's comments.

Well then I have no explanation.

The problem is is not the despawning perse. Its the respawning. In my opinion wolves should be added to the possible spawns List that gets compiled every spawn location. Thats how blazes and wither skeletons can spawn in fortresses. I suspect they already are. If they are its a matter of increasing their weight
In a mod i made i hooked it up and it worked pretty well.

Confirmed that untamed wolves despawn in 1.8.6

Still present in 15w31c.

Confirmed for 15w31c, when walking away or teleporting away. Though, End gateways seems to keep them from despawning somehow even though they are unloaded.

I confirm for 1.8.7 and 1.8.8

I am using OSX 10.8.5 and see the wolf problem, but not a problem with Ocelots.

Still present in 15w45a
Can confirm 15w47c still has this bug.

Confirmed for
15w51b

Confirmed for 16w02a.

Still? Well I hope they fix this in 1.10.
No one is even assigned to the issue anymore...

are you saying it's still in 1.9-pre2?

yes this still exists in 1.9-pre2

Please link to this comment in the description of the report.
The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version.
Based on the code it is "Works as intended" but it creates indeed some problems. One is that wolves and ocelots are relatively rare and wolves will not respawn if other animals are nearby, however the other animals will not despawn. For ocelots it is different as they are for what ever reason added to the monster list, see constructor public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
of the net.minecraft.world.biome.BiomeGenJungle
class.
Removing the protected boolean canDespawn()
method of the net.minecraft.entity.passive.EntityOcelot
and the net.minecraft.entity.passive.EntityWolf
class fixes the despawning "bug" because they will then use the method of their parent class net.minecraft.entity.passive.EntityAnimal
which always returns false
.
The following shows how the despawning method for wolves and ocelots (they have each an own one but both do exactly the same) looks like.
/**
* Determines if an entity can be despawned, used on idle far away entities
*/
protected boolean canDespawn()
{
return !this.isTamed() && this.ticksExisted > 2400;
}

confirming still exists in 1.9 final

confirmed 1.9.1-pre1 1.9.1-pre2 1.9.1-pre3

confirmed for 1.9.2

Wow, just realized that this bug was opened way back in Aug 2013. So I guess we can expect this to be fixed basically NEVER. Great. So how exactly do I play minecraft with wolves and oceloets? And no, spawning them is not the answer. One of the main fun thing about survival is finding stuff. I will never find two very cool parts of this game thanks to this. This bug sucks. And for it to be around for almost 3 years is awful.

@Adam It is my understanding the despawn/no respawn no longer affects ocelots, but I can not confirm that. When I got my 2 cats, I had fish and knew the jungle was there. The wolves were unexpected and I knew of this issue hence the cheat of tp'ing back for bones etc as I am not expanding out for a long while yet. The best you can do is carry bones on you whenever you explore new territory on the off chance of finding them. And yes this is why I have the cheats on - to cope with game play mechanics that the player has no control over.
@mod Should ocelots be removed from description?

@Lee Just tested in 1.9.3-pre3 and ocelots still despawn.

I did some testing too, not Ocelots but wolves again. My findings are very strange. I generated a new world, seed: "Game's Broke". I can fly/teleport/walk whatever over to around X,Y,Z: 142, 70, -127. Each time I tested, there is always two packs of wolves starting in that area. Now here is the thing, most of the time, if I move maybe 100 or so blocks away from them, they despawn and they never come back, in that area or in any other I have found in that whole biome. This happened all but one time. This one time, they never despawned. I teleported as far as 3000, 80, 3000, came back and they were still there. Go figure on that one.
You know I can understand and even want difficulty in finding wolves. I don't want them to be dime a dozen like pigs or cows. But is this how they are doing it? By having them generate with the chunk, never respawn and in all but the rarest cases, they despawn if you leave the area. How close do you have to get to them before you are close enough that they despawn? I know you can hear them but only if you are close. Also, what if you first enter that chunk at night, wolves don't spawn at night right? So did you just blow your one chance to see them? I would really love to know if this is as intended. It seems bugged to me.
One more point on this. I know this bug tracker has a voting system. But you know what, a bug like this is never going get lots of votes. Most people will just assume that they just haven't been lucky enough to find a wolf. Heck, the moderator closed my issue on this at first because he found wolves. 50 bucks says he never saw them again once he left though. My point is just because a bug like this doesn't get tons of votes doesn't mean it shouldn't be fixed. Its been around for almost 3 years if not longer. If the DEVs really did not intent this odd behavior, it needs to be fixed, regardless of the number of votes.

Like an idiot, I have been searching for wolves for endless hours in previously discovered areas after the only one I had at the time drowned before I could get another one to breed. I had played in this same world for 600+ Minecraft days, so more than ample opportunity to at least stumble across another wolf, but nothing. I had roamed in a roughly 9,000 x 7,000 block area. I then stumbled upon MC-101523, which was marked as closed, duplicate (though it is different). Using that as a basis, I used my seed in Amidst and found a cold Tiaga biome that was more than 1,000 blocks away from anywhere I had ever been. I went there and within 10 minutes found a pack of wolves. So, it is clear that if you find wolves in an area, you will never see them in that area again and will be forced to venture out to previously unloaded chunks. The question is why?

@Rich Harris - Marcono1234 did analysis on this - click on the link in the description (the code affected) to see it. TLDR ocelots are linked to a specific biome and should now be respawning, Wolves however are not and the code prevents respawning.
FYI I have seen wolves not just in Cold Taiga, but Taiga, Forest and Birch Forest when checking out new worlds in creative for my next seed. Most casual players are not going to be aware of this and like you will be searching to no avail to find wolves since if you get close enough to trigger the chunk to load, the wolves are gone. All we can do is keep this updated periodically and vote for devs to fix it.
Fix note: This has only been fixed for wolves as they spawn as friendlies. Ocelots spawn as monsters (i.e. continously) and need to be despawned when inactive.

Just fired up the new snapshot, haven't been able to replicate the issue in it.
Nice work Jeb!

@Jeb The ocelots still need to be fixed, as they are the only animal that despawn while named with a nametag or tied up with a lead.

@Jeb PLEASE! Even name tag still does not help with ocelots (unlike other monsters), wtf?! Neither taming, nor a lead. Are you sure it's ok?
Cannot confirm.