Soulsand

From Minecraft Parkour Wiki
Revision as of 13:46, 4 September 2021 by Pjx1314 (talk | contribs) (Marked this version for translation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Other languages:
Soulsand.png

Soulsand is a special block that slows down entities walking on it.


Properties

  • Soulsand is 0.875b tall, meaning it's affected by the slipperiness of ice and slime blocks.
    Walking on soulsand with ice or slime below is slower than walking on regular soulsand.
  • Soulsand slows down entities by multiplying their horizontal velocity by 0.4 at the end of each tick.
  • This effect can be applied even when the player is airborne, notably on the last tick of a jump.
    The only requirement is that the player's bounding box collides with the voxel occupied by the soulsand (minus 0.001m on each side).
  • The effect is cumulative: the 0.4 multiplier is applied for each soulsand block the player is standing on.
    Therefore, it's slightly slower to walk on the seam between two soulsand blocks than it is to walk on a single block.
  • The player can stand on the outer edge of soulsand (up to 0.001m) without being slowed down.
    In many cases, a soulsand jump can be made easier with the right alignment.


Explanation

Below is a slightly simplified snippet of the code that explains the aforementioned properties:
/* In Entity.java, called at the end of each tick (from Entity.moveEntity) */
protected void doBlockCollisions()
{
    BlockPos posMin = new BlockPos(this.minX+0.001, this.minY+0.001, this.minZ+0.001);
    BlockPos posMax = new BlockPos(this.maxX-0.001, this.maxY-0.001, this.maxZ-0.001);

    for (int i = posMin.getX(); i <= posMax.getX(); ++i)
    {
        for (int j = posMin.getY(); j <= posMax.getY(); ++j)
        {
            for (int k = posMin.getZ(); k <= posMax.getZ(); ++k)
            {
                BlockPos pos = new BlockPos(i, j, k);
                Block block = getBlockState(pos);
                block.onEntityCollidedWithBlock(this); //see addendum for blocks that are concerned.
            }
        }
    }
}


/* In BlockSoulSand.java, called from above */
public void onEntityCollidedWithBlock(Entity entityIn)
{
    entityIn.motionX *= 0.4;
    entityIn.motionZ *= 0.4;

    //NOTE: each soulsand block applies this effect individually.
}
Addendum:

OnEntityCollidedWithBlock.png

(The hidden blocks only concern specific entity-block interactions, such as arrows with wood buttons)


Version Differences

1.13

Soulsand generates upward bubble columns when placed underwater, which push the player up.


1.15

Major changes to movement on soulsand:

  • No longer affected by slipperiness (as are all blocks of height > 0.5b)
  • Slowdown now only applies to the inner surface. The 0.3m perimeter around it acts as a normal block.
  • Slowdown applies when the player is standing less than 0.5b above it (includes standing on a slab).
  • If the player manages to get inside a soulsand block, they will find that it has "intermediate floors" that they can stand on. These floors are at heights 0.125, 0.25, 0.375, 0.5, 0.625, and 0.75. The first four are affected by slipperiness.