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

Hi hello, I continued with my mod, and now I'm telling to the blocks that they are

crafting stations to display the crafting table ui. I was reading the code of the

Workbench block and I saw this code

 

 

 

  /**

    * Called upon block activation (right click on the block.)

    */

    public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)

    {

        if (par1World.isRemote)

        {

            return true;

        }

        else

        {

            par5EntityPlayer.displayGUIWorkbench(par2, par3, par4);

            return true;

        }

    }

 

 

 

So I decided to add this code to my block to see what happen, but the code is not working.

My block is a custom block with custom model but is an extension of the minecraft block.

 

I did a short modification in the code

 

 

 

  /**

    * Called upon block activation (right click on the block.)

    */

    public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)

    {

        {

            par5EntityPlayer.displayGUIWorkbench(par2, par3, par4);

            return true;

        }

    }

 

 

 

With the modification my crafting table is working but the ui is opening for half a second and after that

the game is closing the ui so you can't use the ui...

 

If someone can help me... I need a hand again sorry is my first crafting table and I'm looking for information.

 

Thanks.

For my block with Guis I have a gui handler and then instead of the modifiaction of the player.openGui you should have

FMLNetworkHandler.openGui(player, mod.instance, GuiID, world, x, y, z);

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

  • Author

Omg, is so complex to create a whole new crafting table... I was thinking in using the minecraft workbench ui  to try to do the things more easy, but I'm watching that create a custom crafting table is going to be another real pain....

 

Anyone know a good tutorial about that for mc 1.6 series ? Thanks.

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.