From fd5f3a8df715c99d00f7b8d220d5750816519f2e Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 6 Jan 2021 11:47:50 +0100 Subject: [PATCH] Mobs can't jump while already in air --- mods/ENTITIES/mcl_mobs/api.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 4465bea60..a70ff6be6 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -1292,12 +1292,13 @@ local do_jump = function(self) if self.walk_chance == 0 or minetest.registered_items[nod.name].walkable then - if minetest.get_item_group(nod.name, "fence") == 0 + local v = self.object:get_velocity() + + if v.y == 0 + and minetest.get_item_group(nod.name, "fence") == 0 and minetest.get_item_group(nod.name, "fence_gate") == 0 and minetest.get_item_group(nod.name, "wall") == 0 then - local v = self.object:get_velocity() - v.y = self.jump_height set_animation(self, "jump") -- only when defined