垂直方向の動きの公式

    From Minecraft Parkour Wiki
    This page is a translated version of the page Vertical Movement Formulas and the translation is 100% complete.
    Other languages:


    ジャンプの公式

    ジャンプ中のプレイヤーの垂直方向の速度は簡単に計算できる:



    の場合、は0に設定される(そのtickでは高さは変化しない)。

    1.9以降では、このしきい値は0.003となる。


    • は、重要でないため値は割り当てられない。慣用的に、0tick目の速度はジャンプ前の初速に対応する。
    • は、ジャンプの初速に対応する。跳躍力上昇のレベルが1上がるごとに0.1ずつ増加する。
    • 1.9でmomentum thresholdが引き下げられたため、ジャンプの高さが僅かに上昇した(以前=1.249、現在=1.252)。
    • 終端速度は-3.92m/t。
    • ブロックに対して垂直方向に接触すると、垂直方向の移動がキャンセルされ、加速度のみが保持される。


    滞空時間

    ジャンプの滞空時間とは、ジャンプから着地までのtick数のこと。
    また、繰り返しジャンプする場合のジャンプの周期にも対応する。
    この概念は、Tierと関連している。
    説明 滞空時間
    Flatのジャンプ 12 t
    3bcのジャンプ 11 t
    +0.5のジャンプ 10 t
    +1のジャンプ 9 t
    2.5bcのジャンプ 6 t
    2bcのジャンプ 3 t
    1.8125bcのジャンプ 2 t


    ソースコード

    EntityLivingBaseから

    /* 垂直方向の動きに無関係なコードは削除済み */
    
    protected float getJumpUpwardsMotion(){
        return 0.42F;
    }
    
    
    protected void jump()
    {
        this.motionY = this.getJumpUpwardsMotion();
        if (this.isPotionActive(Potion.jump))
        {
            this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
        }
        this.isAirBorne = true;
    }
    
    
    public void moveEntityWithHeading(float strafe, float forward)
    {
        ... /* プレイヤーの水平方向の移動も行われる */
    
        this.motionY -= 0.08;
        this.motionY *= 0.98;
    }
    
    
    public void onLivingUpdate()
    {
        if (this.jumpTicks > 0)
            --this.jumpTicks;
    
        if (Math.abs(this.motionY) < 0.005D)
            this.motionY = 0.0D;
    
    
        if (this.isJumping)
        {
            ... /* 水や溶岩内では異なる */
    
            if (this.onGround && this.jumpTicks == 0)
            {
                this.jump();
                this.jumpTicks = 10; //自動ジャンプクールダウンの発動(0.5秒)
            }
        }
            
        else
        {
            this.jumpTicks = 0; //自動ジャンプクールダウンのリセット
        }
    
        ...
        
        this.moveEntityWithHeading(this.moveStrafing, this.moveForward);
    }