No, golems will only follow you if you've attacked them, which isn't recommended. There's no peaceful way to make them follow you.
Like every mob, though, they can be moved with water streams. Trap them and build a canal to bring them back to the village. Or, if you want their iron, trap them and move them away from the village. Once they are far enough they don't count for the golem spawn limit anymore and new ones will spawn to replace them. Then you can build a crusher to "peacefully" dispose of your extra golems and harvest their iron and roses.
From a decompiled 1.7.10 a teleportRandomly
function is present in in the Enderman defintion.
it is called if the Enderman is:
- wet
- on fire
- in daylight & not fighting
- is fighting & is closer than 16 blocks to their target
(in the last case there is a delay on how often this can be done).
The function generates an X, Y and Z coordinate and places the enderman to that location. The function calls rand.nextDouble()
or rand.nextInt(64)
to generate a value within ±32 of the original value for each of X,Y and Z. It then calls another function a teleportTo()
using these values
(Alternatively if they are fighting and further away from their target, there is a teleport to entity function.)
Therefore, an enderman, without being aggressive, can teleport anywhere within a cube of 64 blocks of itself (subject to having a floor, head room and not ending up in a liquid).
So, to answer the question, no pathing is considered, this teleportation is based on moving directly to a random location.
TL;DR If the room is within 32 blocks of a liquid or daylight and the ceiling is atleast 3 blocks high, an enderman "could" get in randomly without you having any previous contact with it.
Best Answer
On a funny note, you can check out this video for different ways to protect villagers from pillagers during a raid here.
On a serious note, yes and no. While pillagers cannot jump a cobblestone fences, they will still shoot at villagers if they can see them. According to the wiki:
If you make your cobblestone wall three blocks high or higher, it should be high enough to prevent pillagers and ravagers from seeing the villagers at all and trying to shoot them.