Posted June 26, 20169 yr Hello everyone, I'm pretty new to modding and I had a question regarding a way to count items and return a value (count amt.). If that was vague, what I meant was, a way to return a number value based on the total amount of items in a world. ex. Player 1 has 10 XITEM, and Player 2 has 4 XITEM, the value would return as 14. Keep in mind, this has to be a live count. *Not sure if this has been answered before, but I couldn't find anything. Thanks for any help, -kroppen
June 26, 20169 yr Simple answer: This is impossible. Longer answer: ItemStacks can be in World (EntityItem) or in Inventory (Entities' including players' or TileEntities' like chest and other). Aside from that - all of above can be loaded or unloaded from world. Notes: It is possible to parially keep track of stuff - but NEVER fully (because e.g if other mod would add ItemStack somewhere without you knowing, your whole system fails). Knowing above you could ask less demanding (from MC) stuff. Anything comes to you mind? 1.7.10 is no longer supported by forge, you are on your own.
June 26, 20169 yr If you're trying to track a single custom Item type then it might be possible, but certainly not globally for ALL item types. Which item(s) do you want to track? Why do you want to track the total number of items? In other words, what exactly are you trying to accomplish by doing so? http://i.imgur.com/NdrFdld.png[/img]
June 26, 20169 yr Author +coolAlias I was trying to get a total item count for a custom item, one that I've added. The purpose of this was to get a count of MoneyItems, so that I could calculate inflation in-game, affecting the value of the currency in a world market GUI. I was going to track 1-5 items. Thanks -kroppen
June 26, 20169 yr Alright, and how do these custom items come into existence? Are they mined, crafted, dropped? At any of those points, you can increment a global counter and there you go, problem solved http://i.imgur.com/NdrFdld.png[/img]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.