I would like to give a default item to new users entering the world.
Is the code below the correct way to go about doing this; if I (i.e.) would like to give them the "Clay" item?
Code: Select all
minetest.register_on_joinplayer(function(player)
local item = ItemStack("clay")
player:get_inventory():set_stack("main", 1, item)
end)
I am completely new to Lua and the Minetest API, and in the process of customizing a game to be used in a virtual educational drama setting.
Thanks!