スライムブロック

From Minecraft Parkour Wiki
Revision as of 09:47, 7 May 2022 by KK kaku (talk | contribs)
Other languages:

スライムブロックは、その上に落ちるとバウンドするという特性のある特殊ブロックである。


摩擦

スライムブロックのslipperinessは0.8で、通常ブロック(0.6)と氷(0.98)の間に位置する。

それに加え、


バウンド

  • スライムブロックの上に落ちると、垂直方向の速度が反転され、上方向にバウンドする。
  • 着時地にジャンプキーを押しているとバウンドがキャンセルされ、落下ダメージを受けることなく通常通りにジャンプする。
  • 着地時にスニークを押しているとバウンドがキャンセルされ、落下ダメージを受ける。


ソースコード

//called at the end of Entity.moveEntity()
public void onLanded(Entity e)
{
    if (e.isSneaking())
        e.motionY = 0.0;
</div>

    else if (e.motionY < 0.0D)
        e.motionY = -e.motionY;
}

<div lang="en" dir="ltr" class="mw-content-ltr">
//called at the end of Entity.moveEntity(), after the previous method
public void onEntityCollidedWithBlock(Entity e)
{
    if (Math.abs(e.motionY) < 0.1D && !e.isSneaking())
    {
        double mult = 0.4 + Math.abs(e.motionY)*0.2;
        e.motionX *= mult;
        e.motionZ *= mult;
    }
}