Entity movement
This commit is contained in:
@@ -72,6 +72,8 @@ export abstract class LivingEntity extends Entity {
|
||||
// minecraft's per tick movement speed, see travel
|
||||
speed = 0;
|
||||
jumping = false;
|
||||
// whether jumping lifts it off the ground. one that doesn't still steps up its step height and swims up in water
|
||||
jumps = true;
|
||||
#jump_delay = 0;
|
||||
|
||||
// the attributes this kind has and their base values, like minecraft's default attribute suppliers. kinds add
|
||||
@@ -188,7 +190,7 @@ export abstract class LivingEntity extends Entity {
|
||||
if (this.jumping) {
|
||||
if (this.in_water) {
|
||||
this.vy += SWIM_UP * TICKS_PER_SECOND;
|
||||
} else if (this.on_ground && this.#jump_delay === 0) {
|
||||
} else if (this.jumps && this.on_ground && this.#jump_delay === 0) {
|
||||
this.jump_from_ground();
|
||||
this.#jump_delay = JUMP_DELAY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user