diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index 9e2422f8..af8359d7 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -183,6 +183,15 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o cart.on_activate_by_rail = on_activate_by_rail function cart:on_step(dtime) + -- If the driver manages to either die in a minecart + -- or attach to some other object, they may still be + -- taking up space in the cart. Therefore the driver + -- must be detached if the minecart has no children. + if self._driver and + #self.object:get_children() == 0 then + detach_driver(self) + end + if self._pickup_inhibit_timer > 0 then self._pickup_inhibit_timer = self._pickup_inhibit_timer - dtime end