Page 1 of 1

Entity suggestions, and counting inventory items

PostPosted: Mon Dec 05, 2016 08:26
by D00Med
These are just some things I would like to see in minetest.
Firstly, entity roll and pitch. If it's possible to set the yaw, then I would assume it wouldn't be too hard to add "setroll" and "setpitch"? Would it be possible to allow entities to ignore the light changes for the time of day too? They get darker at night and in caves, but if there was an option to make them ignore lighting changes then they could appear to be glowing. Also, it is possible to check if an inventory contains a certain item so, if there isn't already a way to do so, could a method be added to count the quantity of an item in an inventory?

Re: Entity suggestions, and counting inventory items

PostPosted: Fri Dec 16, 2016 05:40
by sofar
could a method be added to count the quantity of an item in an inventory?


https://github.com/minetest/minetest/bl ... .txt#L3014

Re: Entity suggestions, and counting inventory items

PostPosted: Fri Dec 16, 2016 06:15
by D00Med
Thanks, could you give me an example of how to use that?
I thought it would only work for particular stacks in the inventory, not just every one, if they exist.
(and I'll be honest I'm a bit confused about itemstacks)

Re: Entity suggestions, and counting inventory items

PostPosted: Fri Dec 16, 2016 19:18
by sofar
D00Med wrote:Thanks, could you give me an example of how to use that?
I thought it would only work for particular stacks in the inventory, not just every one, if they exist.
(and I'll be honest I'm a bit confused about itemstacks)


An itemstack is "one or more of the same item" that fits in a single "slot". The main inventory is a "list" of "Itemstacks" that are possibly empty.

Re: Entity suggestions, and counting inventory items

PostPosted: Fri Dec 16, 2016 20:19
by D00Med
So to count an item in an inventory, the itemstack or stack index has to be known?