Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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.

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?

  • 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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.