Posted August 15, 201411 yr Like the title says, when I use player.displayGUIWorkbench, I do get the crafting menu but I CANNOT move items in my inventory! code: world.setBlock(0, 0, 0, Blocks.crafting_table, 0, 2); player.displayGUIWorkbench(0, 0, 0); I never post on the forums, but when I do, I have no clue how to do a certain thing.
August 15, 201411 yr You can't open up the gui for the workbench that way. In the container class there's a method called canInteractWith that check's if there's a workbench at the location, which you managed to do with a dirty hack, and if the distance between the workbench and the player is less then 4 blocks away, which it isn't in your case, so it returns false so you can't interact with it. A workaround is making your own gui and container extending the vanilla classes, and modify them a bit to your likings, and open that one, istead of the vanilla one. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
August 15, 201411 yr Author You can't open up the gui for the workbench that way. In the container class there's a method called canInteractWith that check's if there's a workbench at the location, which you managed to do with a dirty hack, and if the distance between the workbench and the player is less then 4 blocks away, which it isn't in your case, so it returns false so you can't interact with it. A workaround is making your own gui and container extending the vanilla classes, and modify them a bit to your likings, and open that one, istead of the vanilla one. READ MY POST My problem is that i cannot move items when the inventory is open, NOT that the inventory is not opening. (aka it is opening) I never post on the forums, but when I do, I have no clue how to do a certain thing.
August 15, 201411 yr You can't open up the gui for the workbench that way. In the container class there's a method called canInteractWith that check's if there's a workbench at the location, which you managed to do with a dirty hack, and if the distance between the workbench and the player is less then 4 blocks away, which it isn't in your case, so it returns false so you can't interact with it. A workaround is making your own gui and container extending the vanilla classes, and modify them a bit to your likings, and open that one, istead of the vanilla one. READ MY POST My problem is that i cannot move items when the inventory is open, NOT that the inventory is not opening. (aka it is opening) He did read your post. He's telling you exactly why it opened but you're not able to interact with it. Maybe YOU should read HIS post, instead of being an ass when someone is helping you.
August 17, 201411 yr Author You can't open up the gui for the workbench that way. In the container class there's a method called canInteractWith that check's if there's a workbench at the location, which you managed to do with a dirty hack, and if the distance between the workbench and the player is less then 4 blocks away, which it isn't in your case, so it returns false so you can't interact with it. A workaround is making your own gui and container extending the vanilla classes, and modify them a bit to your likings, and open that one, istead of the vanilla one. READ MY POST My problem is that i cannot move items when the inventory is open, NOT that the inventory is not opening. (aka it is opening) He did read your post. He's telling you exactly why it opened but you're not able to interact with it. Maybe YOU should read HIS post, instead of being an ass when someone is helping you. But I solved the problem with the workbench checking right? i placed a workbench in the world on coords 0, 0, 0 and opened that workbench. That should work, right? I never post on the forums, but when I do, I have no clue how to do a certain thing.
August 17, 201411 yr Yeah, but your coords are probably way more then 4 blocks away. If you go to 0 0 0 you can move the items. Thats why you made it a dirty work-around, instead of making your own classes, which is the best solution. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
August 17, 201411 yr Simply copy the workbench gui classes and change the method from false to true. Don't forget the gui handler. If I helped please press the Thank You button.
August 17, 201411 yr Simply copy the workbench gui classes and change the method from false to true. Don't forget the gui handler. Copying such a class will simply open the original crafting table. displayGuiWorkbench() is hardcoded that way. -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
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.