Skip to content

BlockUsable

MCE626 edited this page May 25, 2019 · 1 revision

BlockUsable is similar to BlockEdible, however doesn't give you a huger and saturation value. The parameters are the same as BlockBase.

Examples

public static final Block ENDER_PEARL_BLOCK = new EnderPearlBlock("ender_pearl_block", Material.GLASS, BLOCKS, ModItems.ITEMS).setCreativeTab(LittleUtilities.lu).setHardness(1f);

Here the EnderPearlBlock does things itself and extends BlockUsable. Similar to EdibleBlock the mod handles modeling and stuff, but you'll need to still do the blockstate files for your blocks.

{
	"forge_marker": 1,
	"variants": {
		"inventory": [{}],
		"amount": {
			"0": {"model": "xenlib:usable_block_0", "textures": { "all": "littleutilities:blocks/ender_pearl_block"}},
			"1": {"model": "xenlib:usable_block_1", "textures": { "all": "littleutilities:blocks/ender_pearl_block"}},
			"2": {"model": "xenlib:usable_block_2", "textures": { "all": "littleutilities:blocks/ender_pearl_block"}},
			"3": {"model": "xenlib:usable_block_3", "textures": { "all": "littleutilities:blocks/ender_pearl_block"}},
			"4": {"model": "xenlib:usable_block_4", "textures": { "all": "littleutilities:blocks/ender_pearl_block"}},
			"5": {"model": "xenlib:usable_block_5", "textures": { "all": "littleutilities:blocks/ender_pearl_block"}},
			"6": {"model": "xenlib:usable_block_6", "textures": { "all": "littleutilities:blocks/ender_pearl_block"}},
			"7": {"model": "xenlib:usable_block_7", "textures": { "all": "littleutilities:blocks/ender_pearl_block"}},
			"8": {"model": "xenlib:usable_block_8", "textures": { "all": "littleutilities:blocks/ender_pearl_block"}}
		}
	}
}

Whether your block is an edible or usable block, they both use the usable block model file from XenLib. If you're block isn't a full block, but still needs the decreasing size from the top, you'll need to add your own model files. I'll link to the PufferfishBlock model files from LittleUtilities.

References