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

Greetings all.  First off, I apologize in advance if this has been answered elsewhere, but after a good bit of searching I cannot find what I am looking for.  I suspect this is because of a massive failure to understand a key concept on my part.

What I am looking to do is be able to execute custom code when an item is either added or removed from a container.  I have been searching for the equivalent of ItemAdd and ItemRemove events to try to hook, but haven't found much.

UseCase 1: As the owner of a chest, I want to allow another player to open the chest and view the contents, but be unable to remove the contents.
UseCase 2: As the owner of a chest, I want to be notified via chat when another player places an item in the chest.

Not looking for an end to end solution, just for someone to put me onto the right path.  It's obvious I am missing something.

Thanks in advance everyone.

Edited by claymore1977

1. You would need to store the owner of the block in the tile entity instance and make slots accessible based on that comparison flag.

2. A lot of custom container screen handling to make this happen. There is no difference between placing an item and removing it as it just simply is swapping an empty item stack on the cursor for the item stack in the container. So, you will need to define this specific action yourself.

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.