This works if the item count is split up over multiple stacks,įor example looking for “default:stone 200” will work if thereĪre stacks of 99 + 95 + 6. Checking for room if not inv : room_for_item ( "main", stack ) then print ( "Not enough room!" ) end Taking items local taken = inv : remove_item ( "main", stack ) print ( "Took ". "main" is the name of the list you’re adding to. InvRef, Items and Items Adding to a list local stack = ItemStack ( "default:stone 99" ) local leftover = inv : add_item ( "main", stack ) if leftover : get_count () > 0 then print ( "Inventory is full! ". Please note that the sizes of lists will not change. You can then set the list like this: inv : set_list ( "list_one", list ) Player Inventories.Ī player inventory usually has two grids, one for the main inventory, one for crafting. Mod namespace is modlib or ml, containing all variables & functions. Written by Lars Mueller aka LMD or appguru (eu). The player inventory, right (in blue) is a player inventoryĮlement, and is not part of the inventory. Modding Library ( modlib) Multipurpose Minetest Modding Library About No dependencies. The creative inventory, left (in red) is detached and it made up of a This image shows the two inventories visible when you press i.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |