22

Is zombie pigmen spawning (in overworld) affected by light? Do they need to be a specific distance from the player? Do they need some clearance around the portal? Any other influences?

18
+50

Exactly nothing changes whether Zombie Pigman spawn from Nether portals.

(Well, apart from turning on Peaceful, of course.)

Looking at the code for 1.6.2 in MCP, the code for spawning Zombie Pigmen in portals is dead simple, being only 6 lines of code. If the portal block receives a tick, it checks the difficulty against a random number and if successful, tries to spawn a Zombie Pigman with its feet inside the portal block. It does a check to make sure there is headroom and a solid block under the Pigman's feet, which is why they only spawn with their feet inside the two lower portal blocks inside the frame.

That's it. Light level, player location, and the number of Zombie Pigmen nearby aren't consulted at all.

That means that, so long as the portal is active and in a loaded chunk, it will spawn Zombie Pigmen. By implication, the only way to stop them from spawning is to to deactivate the portal so there are no portal blocks to receive ticks, or to go far away from the portal so the game unloads the chunk it's in.

Further implications:

  • Lowering the difficulty level will decrease Zombie Pigmen spawns from portals. The chance of spawning in a given tick is proportional to the difficulty level d: d/2000, or 1/2000 on Easy, 1/1000 on Normal, and 1/666.6 (repeating) on Hard.
  • Since they always spawn within the portal blocks you can easily fence them in.

One method of Zombie Pigmen control that leverages the limited spawning area would be to put doors or fence gates flush against one side of the portal where you normally enter it, and a waterfall at the level of the bottom frame on the other side. This will transport Zombie Pigmen into a holding area where you can dispose of them at your leisure, leaving your portal free for use. If there are any Zombie Pigmen standing in the portal when you want to use it because they haven't gone for a swim yet, you can just gently nudge them into the water flow as you pass through.

  • Do they just need the portal block to spawn, or does it check if the portal is in a frame? – Billy Mailman Aug 10 '13 at 1:51
  • @Billy Just the portal block and a solid block to stand on, so a bare portal block edited in would count too. – SevenSidedDie Aug 10 '13 at 7:17
  • The idea behind this is to give the impression of a Zombie Pigman walking trough a Nether portal. – alexanderpas Aug 11 '13 at 17:55
  • Possibly they changed it with the new portal sizes available in 1.7.2, but looking at the disassembly of 1.7.7 from jad it appears that "it tries to spawn a Zombie Pigman with its feet inside the portal block" should be replaced with something along the lines of "it finds the non-transparent block below the portal block and tries to spawn a Zombie Pigman on top of that". Which explains why a 23x23 portal spawns more Zombie Pigmen than a 23x5 portal. – Anomie Apr 10 '14 at 12:30
  • Note that, while Pigmen only need chunk loaded to spawn, they won't move if the player is not in the range of 32 blocks in it. This is very important when building a farm that relies on them walking out of the portal. I think also the standard mob spawning rules apply, so if the player is 128 blocks away, the will immediately despawn. – Konstantin Pereiaslov Feb 9 '16 at 16:31
5

Look at the Farming topic of the Zombie Pigman article at the Minecraft Wiki.

Farming

A Zombie Pigman farm attached to a mob grinder. Since Zombie Pigmen spawn in the Nether and in Nether Portals in the Overworld, you can build a Zombie Pigman farm in either dimension which provides a steady stream of Gold Nuggets. Additionally, you can obtain Gold Ingots and Gold Swords as rare drops. To construct a farm in the Nether, build platforms for Zombie Pigmen to spawn on, with trapdoors on the edge, and place Slabs on the floors of all surrounding areas (or just fill them in) so Pigmen only spawn on your platforms. You can then use Lava flows to collect the Zombie Pigmen into a central area. To build a farm in the Overworld, construct a rectangular prism of interlocking Nether Portals (to save Obsidian) and put open Trapdoors on the edges of the two bottom Obsidian blocks so that the Zombie Pigmen walk off. From here, you can use Water to collect the Zombie Pigmen into a fall or suffocation trap. Using a fall trap has the benefit of automation, but with a suffocation trap, you are able to use pistons to control the amount of damage to the Pigmen. This way, you can obtain rare drops by killing the Pigmen yourself, perhaps with a Looting III enchantment.

Spawn rate

When ticked the block generates a number between 0 and 2000 inclusive, if that value is less than the difficulty setting, a pigman is generated. This means more pigmen will spawn the higher the level of difficulty.

  • 3
    I saw that article and asked this question precisely because it's so skimpy on details of rules of spawning pigmen in/around overworld portals. In case of other mobs they need to be >24 blocks away to spawn but <32 to move and fall. Do these rules apply? A grinder I saw on Youtube was encased in an enormous room; again, why? light requirements? Can I build over one side of the portal? Which blocks are eligible to spawning pigmen - just bottom of portals, or any blocks around? – SF. Jun 26 '13 at 9:28
  • @SF. The only thing I know is that light doesn't interferes and you need 1 block of space around the nether portal. – Zignd Jun 26 '13 at 15:36
  • The spawns don't need any space around the portal to spawn, at least not in 1.4.7. I actually "closed off" my Nether Portal with a stick piston door on one side and plain old stone wall on the other in the Overworld and they still filled up inside the portal frame itself. – Martin Sojka Aug 9 '13 at 15:14
0

They cannot spawn in other blocks, so you would need a 1x1x2 (lxwxh) place of air somewhere around the portal (everywhere around it would give you a higher chance of spawning). Light level will not affect the spawning of zombie pigmen, nor will player proximity (as long as the chunk is loaded, so the player will have to be in some kind of proximity) As far as I know, these are the only influences for spawning. The spawn rate is, according to your game difficulty, somewhere between 1/667 and 1/2000.

  • 2
    They don't actually spawn around the portal; they actually spawn directly within the frame. – SevenSidedDie Aug 9 '13 at 16:08
  • @SevenSidedDie Ah thank you, I didn't know that. – Ririshi Aug 9 '13 at 17:00
  • Yeah, it's not really obvious. Nothing else spawns like that, so it's quite unusual. – SevenSidedDie Aug 9 '13 at 17:09

protected by fredley Aug 9 '13 at 16:05

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.