Posted August 27, 201510 yr Hello, I want to set the slot of items, that I take from a chest. How can I do that?
August 27, 201510 yr 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.
August 27, 201510 yr 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.
August 27, 201510 yr 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
August 27, 201510 yr 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.
August 27, 201510 yr 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...
August 27, 201510 yr 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
August 27, 201510 yr A nice source should be Inv Tweaks which is open source and on github. PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.
August 27, 201510 yr 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.