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

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.

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/

  • 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.

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.

  • 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.

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/

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.

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.

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.