On the loading screen, the game tells me that mobs won't despawn if they can't move more than 20 blocks. So will a 20x20 fence be good or is that still too much room?
Mobs won't despawn if they can't move more than 20 blocks in any SINGLE direction. So, yes... a 20x20 area is fine. If you are using fences to encase the area, some of the animals might "escape."
What actually happens is the animal is likely pressed up against the fence when the game is saved. When it is reloaded the game sometimes places the animal on the other side of the fence since it is technically the same block. That's why I never use fences for pens. Water barriers make a better containment method.
I've often wondered about that 20x20 limitation... I've never really tested it though. Technically, the rule as stated is if a passive MOB can move 20 blocks in any direction, it can despawn... and the way MC has traditionally measured a diagonal is by counting it as 2 blocks (1 in the X direction and 1 in the Z direction)... such that a 20x20 pen would technically have a 40 block diagonal path from corner to corner.
In theory, by the way distance is measured in game, this should allow passive mobs to despawn if they were closer to a corner than at the center in a 20x20 pen, but I've heard a number of people say that the 20x20 pens work reliably well, so it may be based more off of more straight (less diagonal) measurements?
I've often wondered about that 20x20 limitation... I've never really tested it though. Technically, the rule as stated is if a passive MOB can move 20 blocks in any direction, it can despawn... and the way MC has traditionally measured a diagonal is by counting it as 2 blocks (1 in the X direction and 1 in the Z direction)... such that a 20x20 pen would technically have a 40 block diagonal path from corner to corner.
In theory, by the way distance is measured in game, this should allow passive mobs to despawn if they were closer to a corner than at the center in a 20x20 pen, but I've heard a number of people say that the 20x20 pens work reliably well, so it may be based more off of more straight (less diagonal) measurements?
It's 20 by 20 in a straight line... to count the diagonal as two blocks, one needs to continually change the direction of travel. As a result, in this case, a diagonal block still works as though it was only 1 block. Same applies for the On a Rail Achievement.
Doubling your fence (thickness) might keep more of your sheep in the pen. Double your gates as well and use them as an "airlock" to keep those buggers in the pen when you come and go. I used to lose an animal occasionally, but after doubling the fence, it's happened once (in hundreds of hours).
Doubling your fence (thickness) might keep more of your sheep in the pen. Double your gates as well and use them as an "airlock" to keep those buggers in the pen when you come and go. I used to lose an animal occasionally, but after doubling the fence, it's happened once (in hundreds of hours).
I tested this once. I placed two rolls of fences with one space between them and corralled some sheep into it. I then continual exited and reloaded to see what would happen. Every once in a while one of the sheep would spawn outside the fences.
I didn't test doubled up fences, though, but I would venture a guess that the "occasional" spawn burp would place the MOB on top of the fence, where it can then walk either back into the pen or outside of it.
I tested this once. I placed two rolls of fences with one space between them and corralled some sheep into it. I then continual exited and reloaded to see what would happen. Every once in a while one of the sheep would spawn outside the fences.
I didn't test doubled up fences, though, but I would venture a guess that the "occasional" spawn burp would place the MOB on top of the fence, where it can then walk either back into the pen or outside of it.
Yes, that's what I've seen happen. They spawn or bump each other to the top of a fence, then walk off. I had a sheep pen abutting my mule pen, where the outside of both pens was doubled but the inside divider was a single. Once in a while, sheep would spawn on the mule side. I know they weren't new spawns, because they were colored sheep I was sheering for a project. No mules ever spawned on the wrong side, though.
Well, I made the pen 20x20, but the cattle keep squeezing through the holes of my fences like a gelatinous bovine creature. I must keep them contained, but how?
I can't say I've ever really had this problem. I have had cattle bunching up into corners and glitching through, but then 'rubber banding' back into it again. And I have only really had this happen when the pen is overcrowded. I do have a chicken processor which is only two blocks wide and keep around ten chickens in it at any one time. Then I pull a lever to crush them and the loot falls into dispensers. Sometimes the chickens are glitching as far away as six or seven blocks when I pull the lever and it still kills and collects the loot.
When you say they keep squeezing through, are they literally squeezing through and escaping? Or just squeezing through, but springing back into the pen again?
Also, remember that ocelots can eat penned chickens if you're near the jungle biome and wolves will eat sheep if near the appropriate biome. As far as I know, nothing preys on cows. So if they are disappearing, maked sure your pen is actually the right size. Like people said earlier, it could just be they glitch through during save/reload and end up outside then pen and wander off/despawn.
Well, I made the pen 20x20, but the cattle keep squeezing through the holes of my fences like a gelatinous bovine creature. I must keep them contained, but how?
If you're uncertain whether the cow is actually outside the fence or just looks like it's outside the fence, try walking through it. If you can, then the cow is actually still inside the pen and will eventually snap back into place (i.e. "rubber-band" effect that ConArt70 mentioned). There is nothing you can do to prevent animals from appearing like their glitching through the fences - it's just the way the game is. It is possible to damage an animal that has glitch outside the fence if you take strikes at it, but as long as you don't start hitting the animal, it will return to it's position and be fine.
On occasion the game is erroneously actually position an animal on top or outside the fence when you launch the world. I believe this is due to the fact that the animal can be standing on the same block as the fence itself when you save and exit the map. If you make your fences double-wide (or alternatively a fence inside a cobblestone wall), this does seem to lessen the frequency of such an error occurring. You could also try a single-high inner fence with a double-high outer fence. Putting a roof 3 blocks up also seems to help (but I've heard of some issues now with horses "suffocating" in the roof - can't confirm this though since I haven't upgraded beyond TU16).
Although losing animals can be somewhat frustrating, keep in mind that it happens to ranchers and farmers IRL all the time. Cattle are notorious for breaking through fences and I've seen the occasional horse that could jump clean out of a stall in a barn (and manipulate the barn door latch with it's lips) ... and did it almost nightly until we sold it. So, I tend to consider that losing the occasional Minecraft animal to this spawning error just adds a little bit of realism to the game.
On the loading screen, the game tells me that mobs won't despawn if they can't move more than 20 blocks. So will a 20x20 fence be good or is that still too much room?
Mobs won't despawn if they can't move more than 20 blocks in any SINGLE direction. So, yes... a 20x20 area is fine. If you are using fences to encase the area, some of the animals might "escape."
What actually happens is the animal is likely pressed up against the fence when the game is saved. When it is reloaded the game sometimes places the animal on the other side of the fence since it is technically the same block. That's why I never use fences for pens. Water barriers make a better containment method.
I've often wondered about that 20x20 limitation... I've never really tested it though. Technically, the rule as stated is if a passive MOB can move 20 blocks in any direction, it can despawn... and the way MC has traditionally measured a diagonal is by counting it as 2 blocks (1 in the X direction and 1 in the Z direction)... such that a 20x20 pen would technically have a 40 block diagonal path from corner to corner.
In theory, by the way distance is measured in game, this should allow passive mobs to despawn if they were closer to a corner than at the center in a 20x20 pen, but I've heard a number of people say that the 20x20 pens work reliably well, so it may be based more off of more straight (less diagonal) measurements?
It's 20 by 20 in a straight line... to count the diagonal as two blocks, one needs to continually change the direction of travel. As a result, in this case, a diagonal block still works as though it was only 1 block. Same applies for the On a Rail Achievement.
Doubling your fence (thickness) might keep more of your sheep in the pen. Double your gates as well and use them as an "airlock" to keep those buggers in the pen when you come and go. I used to lose an animal occasionally, but after doubling the fence, it's happened once (in hundreds of hours).
I tested this once. I placed two rolls of fences with one space between them and corralled some sheep into it. I then continual exited and reloaded to see what would happen. Every once in a while one of the sheep would spawn outside the fences.
I didn't test doubled up fences, though, but I would venture a guess that the "occasional" spawn burp would place the MOB on top of the fence, where it can then walk either back into the pen or outside of it.
Yes, that's what I've seen happen. They spawn or bump each other to the top of a fence, then walk off. I had a sheep pen abutting my mule pen, where the outside of both pens was doubled but the inside divider was a single. Once in a while, sheep would spawn on the mule side. I know they weren't new spawns, because they were colored sheep I was sheering for a project. No mules ever spawned on the wrong side, though.
Well, I made the pen 20x20, but the cattle keep squeezing through the holes of my fences like a gelatinous bovine creature. I must keep them contained, but how?
I can't say I've ever really had this problem. I have had cattle bunching up into corners and glitching through, but then 'rubber banding' back into it again. And I have only really had this happen when the pen is overcrowded. I do have a chicken processor which is only two blocks wide and keep around ten chickens in it at any one time. Then I pull a lever to crush them and the loot falls into dispensers. Sometimes the chickens are glitching as far away as six or seven blocks when I pull the lever and it still kills and collects the loot.
When you say they keep squeezing through, are they literally squeezing through and escaping? Or just squeezing through, but springing back into the pen again?
Also, remember that ocelots can eat penned chickens if you're near the jungle biome and wolves will eat sheep if near the appropriate biome. As far as I know, nothing preys on cows. So if they are disappearing, maked sure your pen is actually the right size. Like people said earlier, it could just be they glitch through during save/reload and end up outside then pen and wander off/despawn.
If you're uncertain whether the cow is actually outside the fence or just looks like it's outside the fence, try walking through it. If you can, then the cow is actually still inside the pen and will eventually snap back into place (i.e. "rubber-band" effect that ConArt70 mentioned). There is nothing you can do to prevent animals from appearing like their glitching through the fences - it's just the way the game is. It is possible to damage an animal that has glitch outside the fence if you take strikes at it, but as long as you don't start hitting the animal, it will return to it's position and be fine.
On occasion the game is erroneously actually position an animal on top or outside the fence when you launch the world. I believe this is due to the fact that the animal can be standing on the same block as the fence itself when you save and exit the map. If you make your fences double-wide (or alternatively a fence inside a cobblestone wall), this does seem to lessen the frequency of such an error occurring. You could also try a single-high inner fence with a double-high outer fence. Putting a roof 3 blocks up also seems to help (but I've heard of some issues now with horses "suffocating" in the roof - can't confirm this though since I haven't upgraded beyond TU16).
Although losing animals can be somewhat frustrating, keep in mind that it happens to ranchers and farmers IRL all the time. Cattle are notorious for breaking through fences and I've seen the occasional horse that could jump clean out of a stall in a barn (and manipulate the barn door latch with it's lips) ... and did it almost nightly until we sold it. So, I tend to consider that losing the occasional Minecraft animal to this spawning error just adds a little bit of realism to the game.