Please read this:
http://dev.minetest.net/TerminologyBut I think this page is not so good, so I explain in my own terms:
item: Anything you can store in an inventory. Includes nodes, tools, craftitems (this is important to know!). Items have a default (!) stack size of 99, unless for tools which can never be stacked. All items can potentionally be used as part of crafting recipes.
node: An item you can place in the world, like a block. These are very important, they make the “blocks” in the world. Read the Lua documentation to learn more about nodes. Example: Cobblestone
- craftitem: Usually this is an item you can only use in inventory. There may or may not some additional uses. Craftitems are often used (as the name suggests) in crafting recipes, but more functionality can still be added. Example: Flour
- tool: An item you can use in some way when you wield it. You can punch or rightclick to do something. Tools also include weapons. Tools also have the special property of being able to be worn out by using it, so tools are commonly used for mining tools. Tools have a stack size of 1 and as far I know it can't be changed (probably because Minetest needs to keep track of the wear level for each tool). Example: Wooden Pickaxe
- noneitem: I have never heard of this term before. Where did you hear that?
In my experience craftitems and tools can be very similar, they can almost be used interchangably. Because both of them can have special behaviour by using attack key or rightclick. Craftitems are probably a bit more flexible but they can't have wear levels. My recommendation is this: If you don't need to track wear, use a craftitem, but if you need wear, use a tool. Also, as far I know mining can only be done by tools, not by craftitems, but I have not checked that.
Technically, the boat is a craftitem. (As long it is in your inventory. If you placed it, the boat you see in the world is an entity). The fence is, as already pointed out, a node.
All buckets are craftitems. This allows to use a stack size of 99 for the empty bucket. Filled buckets have a stack size of 1, set manually. They don't need to be tools since they don't wear out and are also not “really” used for mining.
I am surprised that dyes are still at 99. Dyes are craftitems, so they should be limited to 16, I guess. The dye definition does NOT, I repeat, NOT set stack_max explicitly.
On the other hand, I don't understand why your code:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.craftitemdef_default.stack_max=16
minetest.nodedef_default.stack_max=17
minetest.noneitemdef_default.stack_max=18
works at all. It works for me as well, but craftitemdef_default is not documented in lua_api.txt. Where did you find out of minetest.craftitemdef_default and the others?
EDIT: The 99 dyes thing is probably because it has no dependencies, it does not even depend on default. So maybe dye is loaded first and therefore does not “notice” your additional code in the default mod. If you add the same code into the dyes mod, the stack size is limited to 16, which is the expected result. :-)