During generation, a structure has the option to run the following function:
protected void spawnVillagers(World worldIn, StructureBoundingBox sbb, int X, int Y, int Z, int maxVillagers)
{
if (this.villagersSpawned < maxVillagers)
{
for (int i = this.villagersSpawned; i < maxVillagers; ++i)
{
int xOffset = this.getXWithOffset(X + i, Z);
int yOffset = this.getYWithOffset(Y);
int zOffset = this.getZWithOffset(X + i, Z);
if (!sbb.isVecInside(new BlockPos(xOffset, yOffset, zOffset)))
{
break;
}
++this.villagersSpawned;
EntityVillager entityvillager = new EntityVillager(worldIn);
entityvillager.setLocationAndAngles(xOffset + 0.5D, yOffset, zOffset + 0.5D, 0.0F, 0.0F);
entityvillager.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityvillager)), (IEntityLivingData)null);
entityvillager.setProfession(this.func_180779_c(i, entityvillager.getProfession()));
worldIn.spawnEntityInWorld(entityvillager);
}
}
}
As long as the number villagers spawned for this individual structure is less than the maximum input, it will attempt to spawn a villager at the specified coordinates (which are initially relative to the corner of the structure's bounding box) provided it's not inside a block. To reiterate: the villagersSpawned
is not for the entire village, but for this individually-spawned structure.
An example of the function being called, which is used by the "church" structure:
this.spawnVillagers(worldIn, structureBoundingBoxIn, 2, 1, 2, 1);
The maximum number of villagers to spawn inside a church is 1 and will always spawn at the provided offset coordinates.
Out of all the structures available, only large and small farms do not use this function.
Here are images where villagers will always spawn, represented by armor stands (though rotation of the structure may cause them to be mirrored on the other side).
Overview
Here is an example village where villager spawns are highlighted (armor stands with the Glowing effect):
Church
Wood Hut
Large House
Butcher's Shop
Library
Small House
Blacksmith
According to decompiled Minecraft code used in Forge, there is nothing that uses player's velocity for thrown items nor projectiles (arrows, eggs, snowballs). All that is taken into account is the (world,x,y,z) position of player and the angle you are looking at.
So all that can differentiate is the initial position and the angle where you look. If you jump, your initiate position will be higher.
Then it is all about the "throw in gravity field" problem, where gravity is according to code this (for thrown items):
this.motionY -= 0.03999999910593033D;
This is the change of velocity in y axis, so every tick (20 times per second), the velocity in y-axis will decrease by this number. Therefore if you throw it in the best angle, it will land at the most distant point. For normal world, this angle is about 45°.
Do mind that if the projectile or item passes through flowing water, the water's velocity will affect the projectile's velocity.
Best Answer
TLDR: About 60.5 to 60.8 blocks per second.
I made a command block setup that tracks the current velocity of an arrow by comparing its current
Pos
NBT tag to the one 1 game tick ago, with a scale factor of 1000000, and save the maximum value over time. Then I used/tp
to align myself exactly to one of the six axis directions and shot multiple arrows at full power. The results:The exact number probably depends on when exactly in the 0.05 seconds I shot the arrow.
Negative Y is a bit of a different story, because the arrow speeds up while going downwards. I can easily get the terminal velocity of a falling arrow shot down (about 100.2 blocks/second, faster than a sheep), but getting the starting value is difficult. I tried giving the arrow
NoGravity:1
as soon as it was shot and setting the maximum upwards velocity scoreboard to -2147000000 and then checking the maximum upwards velocity (which is negative, because downwards) and just relied on the first tick being the slowest. That, after multiple tries, gave me at most a speed of 3025818, meaning 60.51636 blocks/second. But it was probably already affected by gravity, air resistance or whatever, so it's not necessarily absolutely correct.The maximum of all of these values is 60.8196, the average is 60.63814, 60.662496 without downwards, 60.68326 without upwards and downwards.