Started by
alparda112
on
Topic category: Help with Minecraft modding (Java Edition)
Hello,
So I made a "weight" item and the amount of this item in a players inventory is important for me. But I can't find a way to count the number of item:weight in players inventory... I searched a lot but couldn't find anything about this topic. Help is appreciated a lot.
Use for each item in entity inventory and check if item is of desired type, and if it is, increment local variable storing count for the stack size of the itemstack iterator
@Klemen Can You Send A Photo Of Procedure ?
This code looks for any items in any entity's inventory and replaces it. In my case, it takes a modded turkey item and replaces it with my own custom turkey item. i have tested with vanilla items, this does garauteed work.
I will try to make a block entity version.
nevermind the block entity thing isnt related to the original, im going to make a forum post about these