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

Hi all. I need to know when the player gains an item of my mod. Be it by picking it up from the ground, getting it out of a chest or anything else. I need this to register an achievement.

 

I can use ItemPickupEvent to get notified when the player picks up an item from the ground but that doesn't work for picking up from a chest or other inventory.

 

So ideally I would like to have an event that is fired when the player gains an item in his/her inventory. Is there something like that?

 

Thanks!

 

How does that help me? Nothing will fire that event?

 

Subscribe on a tick handler, scan the inventory, if it changes send an event that the players inventory changed.

I require Java, both the coffee and the code :)

Well, it kind of is... But at the end of the day there is no existing event that notifies you on a slot or inventory changes.

 

Currently looking at the inventory code, I cannot see an easier way to do this. Unless you hack the inventory code and add you own event in there.

I require Java, both the coffee and the code :)

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.