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!

Is there a good way to detect if a player is trying to open their inventory? I want to open some other container is some cases when they do that.
This is only server side. I also want to make sure that in the case where I want to open a different container instead they are 100% unable to take their armor off. I think that may not be possible tho, because it might just be up to the client to modify its inventory and send the changes to the server (like it can say "hey I moved my helmet to slot 35, cool?") But not sure on that, if this is not possible it's not that big of deal, but I will need another solution to make sure they can't move their armor into their inventory (thinking of tagging their armor with something like "disallowed" and then periodically checking if they somehow managed to get a disallowed item).

Thanks

  • Author

Damn, that is slightly problematic for my case.
Oh, well I will find a workaround then, thank you

  • Author

Continuing this topic I still want to prevent a lot of inventory interaction, is it possible to mess with the itemstack held by the cursor from the server?
Only the client appears to know about that, how is that possible, the inventory actually changes when the client picks up an item from their inventory, the server has to know about the new empty slot, or is that it, just a new empty slot that appears? As far as the server is concerned, where is the itemstack that is being held?

  • Author

Is  it possible that it is a bug that it isnt being set correctly on the server ?

I think you can subscribe to the GuiOpenEvent and check if the event.getGui is an InventoryScreen. Then just replace with you own gui and load the custom container

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.