Update init.lua

disable tree bark drop when creative mode is enabled
This commit is contained in:
minefaco 2020-11-07 16:44:12 -05:00 committed by GitHub
parent a86ac9a1b3
commit 6b8e0f7c50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -68,7 +68,11 @@ for _, axe_name in ipairs(axe_types) do
if not creative_mode then
local inv = user:get_inventory()
inv:add_item("main", {name="default:tree_bark"})
if inv:room_for_item("main", "default:tree_bark") then
inv:add_item("main", {name="default:tree_bark"})
else
--drop item
end
end
return itemstack
end