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

Where would I find reference to half-slabs to use in crafting recipes? I can only find wooden and stone in block.java

I think it uses Metadata... so stone is actually stone, brick and cobble, while wood covers all 4 types of wood.

Did I help? Hitting 'Thank You' would be appreciated.

 

Soon, the lost city will rise from the bottom of the ocean, and spread it's technology across Minecraft.

  • Author

I figured it was meta data, I just haven't the slightest clue as to how to access it in my code as well as not modifying base classes. My code is bellow but it only works with the original wood planks/steps. I am trying to give the user a way to craft slabs/stairs back into the original materials given they have the required amount.

 

 

 

ItemStack StackSlab = new ItemStack(Block.woodSingleSlab);

GameRegistry.addShapelessRecipe(new ItemStack(Block.planks, 3, 0),

new Object[] {

new ItemStack(Block.woodSingleSlab), (Block.woodSingleSlab), (Block.woodSingleSlab),

(Block.woodSingleSlab), (Block.woodSingleSlab), (Block.woodSingleSlab)

});

 

 

  • Author

Thank you so much. Now is there a way to apply this to multiple variables (oak spruce etc.) without having to make multiple recipes

 

ItemStack SlabStack = new ItemStack(Block.woodSingleSlab.blockID, 1, 0);

GameRegistry.addShapelessRecipe(new ItemStack(Block.planks.blockID, 3, 0),

new Object[] {

SlabStack, SlabStack, SlabStack, SlabStack, SlabStack, SlabStack

});

 

Using -1 will allow any Metadata to be used in the recipe, but it will probably not give you the correct wood blocks....

 

But you could add the recipes in a simple for loop.

 

for(int i = 0; i <= 3; i++) {
      GameRegistry.addShapelessRecipe(new ItemStack(Block.planks, 3, i),
            new Object[] {
            new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i),
            new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i)
            });
}

that should work.

  • Author

Using -1 will allow any Metadata to be used in the recipe, but it will probably not give you the correct wood blocks....

 

But you could add the recipes in a simple for loop.

 

for(int i = 0; i <= 3; i++) {
      GameRegistry.addShapelessRecipe(new ItemStack(Block.planks, 3, i),
            new Object[] {
            new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i),
            new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i), new ItemStack(Block.woodSingleSlab, 1, i)
            });
}

that should work.

THE FOR LOOP! Why didn't I think of that. Thank you so much

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.