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,

 

I want to set the slot of items, that I take from a chest.

How can I do that?

I assume you want to alter the behaviour of a vanilla Chest?

If so there is no event that is fired when the player attempts to take an Item out of an Inventory slot.

The simplest way to archive this would be to make a new block that behaves like a chest and that uses the same container classes etc. and then extend those classes to change their behavior.

I assume that it is also possible using reflection but that is slow and more difficult but then you wouldn't need to make a new block.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

  • Author

I assume you want to alter the behaviour of a vanilla Chest?

If so there is no event that is fired when the player attempts to take an Item out of an Inventory slot.

The simplest way to archive this would be to make a new block that behaves like a chest and that uses the same container classes etc. and then extend those classes to change their behavior.

I assume that it is also possible using reflection but that is slow and more difficult but then you wouldn't need to make a new block.

 

No, I want to set the slot of an item that I am dragging from the vanilla chest into my own inventory.

If you are talking vanilla chest, I'll offer another solution.

 

Cancel the interact event for vanilla chests with event, then open your own GUI that looks just like the vanilla chest GUI.  Then you can manipulate anything you want.

 

 

Long time Bukkit & Forge Programmer

Happy to try and help

Shouldn't he also be able to re-register his own Container / GUI for the chest?

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

  • Author

Guys,

 

I want to open a normal SurvivalGames-Chest (on Hive or any other server) and to sort the items, when I drag them into my inventory...

Oh,

 

That is something you should have put in the first post.

 

You want it to one time sort or periodically do it?

 

If periodically, just set up a tick event to fire off a sorter every so often.

 

If you want one time, just watch for the gui to be closed and fire it or watch for your inventory to change.

Long time Bukkit & Forge Programmer

Happy to try and help

inv[2] = inv[1]

inv[1] = null

 

 

Long time Bukkit & Forge Programmer

Happy to try and help

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.