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 all,

I currently I looking to make something like this in forge.

https://www.spigotmc.org/resources/guishop.2451/

However, I am unsure how to listen for click events(if that is even possible). Is there a way to prevent items from being removed from container and perform action on click? Currently I am using ContainerListener to listen to slotChanged. This is okay but still allows player to remove items. Is there anyway I can stop this and use less logic by listening for some slot clicked event?

-Thanks 

  • Author
8 hours ago, diesieben07 said:

These plugins will use the "generic" menus (MenuType.GENERIC_9x1 - GENERIC_9x6). These are used in vanilla for chests. As the client has no idea that it must not remove items from such a menu, it will happily do so and there is no way to prevent it. You have to detect it removing something (i.e. the player picking something up) and undo the action server side immediately.

However because Forge allows client side mods there are much better options using a custom GUI.

I can detect when a slot is changed to air(item is removed), I don’t know how to remove the item from player cursor before they place it. Is there a solution to this?

 

If I wanted to go down the custom GUI route, how would I do so? What classes do I need to make a custom GUI?

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.