Skip to content

BlockPaneBase

MCE626 edited this page May 25, 2019 · 2 revisions

BlockPaneBase is similar to BlockBase however makes the block a pane, like the glass pane or iron bars. The parameters are the same, but it adds one more, and boolean to allow the block to drop itself if it's harvested. Glass panes have this as false, iron bars is true.

The model stuff is handled by minecraft, however you'll still need to do stuff with the blockstate files. You can take a look at minecraft's stuff or LittleUtilities.

Examples

Similar to BlockBase you can just use it when declaring the block. No need to make a new block class and extend this one.

public static final Block GOLD_BARS = new BlockPaneBase("gold_bars", UTIL_METAL, BLOCKS, ModItems.ITEMS, true).setCreativeTab(LittleUtilities.lu);

The last parameter is a boolean and if it's set to true, the block will drop itself when harvested. Otherwise it won't, like the glass pane.

You'll still need to do stuff with the blockstate files. I won't be posting all that code here, as it's a lot and several different files. So I'll just link them. Again, you can also look at vanilla minecraft's files for glass pane and iron bars.

References