diff --git a/mods/ITEMS/mcl_boats/init.lua b/mods/ITEMS/mcl_boats/init.lua index 7469e1c653..b50e43dc6d 100644 --- a/mods/ITEMS/mcl_boats/init.lua +++ b/mods/ITEMS/mcl_boats/init.lua @@ -59,13 +59,13 @@ function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, d if self._driver then self._driver:set_detach() self._driver = nil - if not minetest.setting_getbool("creative_mode") then + if puncher and puncher:is_player() and (not minetest.setting_getbool("creative_mode")) then puncher:get_inventory():add_item("main", "mcl_boats:boat") end self.object:remove() else - if not minetest.setting_getbool("creative_mode") then + if puncher and puncher:is_player() and (not minetest.setting_getbool("creative_mode")) then puncher:get_inventory():add_item("main", "mcl_boats:boat") end self.object:remove()