Skip to content

Creating Piece Packs

Shnupbups edited this page Jul 26, 2019 · 1 revision

Extra Pieces uses .json files known as Piece Packs to determine what blocks to add. If there aren't any piece packs (for example, if you've just downloaded the mod) it will create a default one for you provided generateDefaultPack is set to true in the Config. You can add more Piece Packs or edit the default pack to modify the blocks the mod adds, adding, removing or changing Piece Sets.

Though one could figure out how to write a Piece pack by looking at the default, this page will attempt to show you how to make one, and what each of the fields do.

Adding a basic Piece Set

Adding a new 'Piece Set' can be rather simple if you don't need to do too much with it. Here's how you could add a full piece set for dirt.

Click for JSON
{ 
	"dirt": { 
		"base": "minecraft:dirt"
	}
}

Making a .json file with the above will make the mod add a dirt version of every piece type. To add another piece set, you can do something like this:

Click for JSON
{ 
	"dirt": { 
		"base": "minecraft:dirt"
	},
	"diamond_ore": {
		"base": "minecraft:diamond_ore"
	}
}

And now, you have diamond ore pieces too!

More complex settings

Stonecuttable

By default, the dirt pieces won't be craftable in a vanilla Stonecutter because Dirt's material isn't STONE or METAL. Blocks' materials can be found here. As Diamond Ore's material is STONE, it will be craftable in a Stonecutter. What if we wanted to change that around, so Dirt can be stonecut and diamond ore cannot?

Click for JSON
{ 
	"dirt": { 
		"base": "minecraft:dirt",
		"stonecuttable": true
	},
	"diamond_ore": {
		"base": "minecraft:diamond_ore",
		"stonecuttable": false
	}
}

There! Now Dirt pieces can be made in a stonecutter, and Diamond Ore ones can't.

Include and Exclude

Now, say you decide you don't like Dirt fences. Everything else is fine, just not the fences. Alright, let's get rid of them!

Click for JSON
{ 
	"dirt": { 
		"base": "minecraft:dirt",
		"stonecuttable": true,
		"exclude": [
			"extrapieces:fence"
		]
	},
	"diamond_ore": {
		"base": "minecraft:diamond_ore",
		"stonecuttable": false
	}
}

No more dirt fences! IDs for Pieces can be found on the Pieces page. When you specify exclude, any piece types listed in it will not be made. Hold on, dirt fence gates are still a thing. Let's get rid of them too.

Click for JSON
{ 
	"dirt": { 
		"base": "minecraft:dirt",
		"stonecuttable": true,
		"exclude": [
			"extrapieces:fence",
			"extrapieces:fence_gate"
		]
	},
	"diamond_ore": {
		"base": "minecraft:diamond_ore",
		"stonecuttable": false
	}
}

Beautiful. And you know what? For diamond ore, I only want it to have a slab. None of the other things, just a slab. Oh, and I suppose a siding too. What good is a slab without a vertical equivalent, eh? That'd be almost like vanilla. But removing every other piece would be a long exclude, wouldn't it? Well then...

Click for Diamond Ore JSON
"diamond_ore": {
	"base": "minecraft:diamond_ore",
	"stonecuttable": false,
	"include": [
		"extrapieces:slab",
		"extrapieces:siding"
	]
}

Fantastic! We're looking good. If include is specified, everything except the pieces listed will be excluded. It's the opposite of exclude.

Vanilla Pieces

Lets add another piece set! Let's do... sandstone! (Sandstone is added by the default set, so this is purely for example purposes)

Click for JSON
{ 
	"dirt": { 
		"base": "minecraft:dirt",
		"stonecuttable": true,
		"exclude": [
			"extrapieces:fence",
			"extrapieces:fence_gate"
		]
	},
	"diamond_ore": {
		"base": "minecraft:diamond_ore",
		"stonecuttable": false,
		"include": [
			"extrapieces:slab",
			"extrapieces:siding"
			]
	},
	"sandstone": {
		"base": "minecraft:sandstone"
	}
}

Wait, hold on a second. Sandstone already has stairs, a slab and a wall in vanilla! We could just exclude them so the mod doesn't make new ones, but then recipes like converting from the vanilla slab to a siding wouldn't work! How do we let the mod know that there already is a Sandstone Slab, Sandstone Stairs and Sandstone Wall?

Click for Sandstone JSON
"sandstone": {
	"base": "minecraft:sandstone",
	"vanilla_pieces": { 
		"extrapieces:wall": "minecraft:sandstone_wall",
		"extrapieces:slab": "minecraft:sandstone_slab",
		"extrapieces:stairs": "minecraft:sandstone_stairs"
	}
}

Alright, this one's a bit more complex than include or exclude. Here, we tell it that the block minecraft:sandstone_wall is this set's extrapieces:wall piece. We do the same for the slab and stairs. Now it knows it doesn't need to make them, but it can also use them in recipes and stuff! Cool!

Textures

But if you open your game, it looks a bit off, doesn't it? That's because Sandstone has a different texture for its top and bottom than it has on its sides, but our pieces have the side texture all over! Can we fix that?

Click for Sandstone JSON
"sandstone": {
	"base": "minecraft:sandstone",
	"vanilla_pieces": { 
		"extrapieces:wall": "minecraft:sandstone_wall",
		"extrapieces:slab": "minecraft:sandstone_slab",
		"extrapieces:stairs": "minecraft:sandstone_stairs"
	},
	"textures": {
		"top": "minecraft:block/sandstone_top",
		"bottom": "minecraft:block/sandstone_bottom"
	}
}

Much better. By default, all sides will use a texture with the same name as the block the piece set is based on, within the same namespace. You can change that with textures. Here, you can specify a main, top and bottom texture. If no bottom is specified, it will be the same as top. If no top is specified, it will be the same as main. If no main is specified, it will use the default.

Custom Translations

Certain pieces won't have... very neat names if they use the regular system. Diamond Block slabs, for example, would be called 'Block of Diamond Slab' instead of the much neater 'Diamond Slab'.

Luckily, if you name your piece set something particular it will, instead of using the base block's name in theirs, use a custom key from the language file in their name. If your piece set is named diamond, the key will be pieceSet.diamond. Many custom translation keys that would suit vanilla blocks, including diamond blocks, are included in Extra Pieces by default.

Click for a list of pre-made custom translation keys
  • For Oak Planks: pieceSet.oak: Oak
  • For Spruce Planks: pieceSet.spruce: Spruce
  • For Birch Planks: pieceSet.birch: Birch
  • For Jungle Planks: pieceSet.jungle: Jungle
  • For Acacia Planks: pieceSet.acacia: Acacia
  • For Dark Oak Planks: pieceSet.dark_oak: Dark Oak
  • For Snow Block: pieceSet.snow: Snow
  • For Magma Block: pieceSet.magma: Magma
  • For Hay Bale: pieceSet.hay: Hay
  • For Block of Iron: pieceSet.iron: Iron
  • For Block of Gold: pieceSet.gold: Gold
  • For Block of Diamond: pieceSet.diamond: Diamond
  • For Block of Coal: pieceSet.coal: Coal
  • For Block of Lapis Lazuli: pieceSet.lapis_lazuli: Lapis Lazuli
  • For Bone Block: pieceSet.bone: Bone
  • For Bricks: pieceSet.brick: Brick
  • For Stone Bricks: pieceSet.stone_brick: Stone Brick
  • For Cracked Stone Bricks: pieceSet.cracked_stone_brick: Cracked Stone Brick
  • For Chiseled Stone Bricks: pieceSet.chiseled_stone_brick: Chiseled Stone Brick
  • For Mossy Stone Bricks: pieceSet.mossy_stone_brick: Mossy Stone Brick
  • For Nether Bricks: pieceSet.nether_brick: Nether Brick
  • For Red Nether Bricks: pieceSet.red_nether_brick: Red Nether Brick
  • For End Stone Bricks: pieceSet.end_stone_brick: End Stone Brick
  • For Block of Quartz: pieceSet.quartz: Quartz
  • For Chiseled Quartz Block: pieceSet.chiseled_quartz: Chiseled Quartz
  • For Nether Wart Block: pieceSet.nether_wart: Nether Wart
  • For Tube Coral Block: pieceSet.tube_coral: Tube Coral
  • For Brain Coral Block: pieceSet.brain_coral: Brain Coral
  • For Bubble Coral Block: pieceSet.bubble_coral: Bubble Coral
  • For Fire Coral Block: pieceSet.fire_coral: Fire Coral
  • For Horn Coral Block: pieceSet.horn_coral: Horn Coral
  • For Dead Tube Coral Block: pieceSet.dead_tube_coral: Dead Tube Coral
  • For Dead Brain Coral Block: pieceSet.dead_brain_coral: Dead Brain Coral
  • For Dead Bubble Coral Block: pieceSet.dead_bubble_coral: Dead Bubble Coral
  • For Dead Fire Coral Block: pieceSet.dead_fire_coral: Dead Fire Coral
  • For Dead Horn Coral Block: pieceSet.dead_horn_coral: Dead Horn Coral
  • For Dried Kelp Block: pieceSet.dried_kelp: Dried Kelp
  • For Red Mushroom Block: pieceSet.red_mushroom: Red Mushroom
  • For Brown Mushroom Block: pieceSet.brown_mushroom: Brown Mushroom
  • For Purpur Block: pieceSet.purpur: Purpur
  • For Grass Block: pieceSet.grass: Grass
  • For Oak Leaves: pieceSet.oak_leaf: Oak Leaf
  • For Spruce Leaves: pieceSet.spruce_leaf: Spruce Leaf
  • For Birch Leaves: pieceSet.birch_leaf: Birch Leaf
  • For Jungle Leaves: pieceSet.jungle_leaf: Jungle Leaf
  • For Acacia Leaves: pieceSet.acacia_leaf: Acacia Leaf
  • For Dark Oak Leaves: pieceSet.dark_oak_leaf: Dark Oak Leaf

Any not on this list will can be made through a resource pack.

Uncraftable

Okay, let's combine what we know to make an Oak Planks set. (again, one exists in the default set, so this is purely for example purposes)

Click for Oak Planks JSON
"oak": { 
	"base": "minecraft:oak_planks",
	"vanilla_pieces": { 
		"extrapieces:fence_gate": "minecraft:oak_fence_gate",
		"extrapieces:slab": "minecraft:oak_slab",
		"extrapieces:stairs": "minecraft:oak_stairs",
		"extrapieces:fence": "minecraft:oak_fence"
	}
}

Looks good, right? But we've got another problem: the recipe for Oak Walls will overwrite the vanilla Oak Trapdoor recipe! A way to get around this is to mark the wall as being uncraftable.

Click for Oak Planks JSON
"oak": { 
	"base": "minecraft:oak_planks",
	"vanilla_pieces": { 
		"extrapieces:fence_gate": "minecraft:oak_fence_gate",
		"extrapieces:slab": "minecraft:oak_slab",
		"extrapieces:stairs": "minecraft:oak_stairs",
		"extrapieces:fence": "minecraft:oak_fence"
	},
	"uncraftable": [ 
		"extrapieces:wall"
	]
}

Voila! Oak Trapdoors are craftable again. Unfortunately, Oak Walls are not. If you were to specify stonecuttable to be true, however, you could still make the Oak Wall in the Stonecutter. By default, however, the wall is made unobtainable for survival players.

Opaque

There is one other thing you can specify: opaque. It defaults to whether the base block of the set is opaque or not, but can be modified independently. If set to false, the pieces will 'work' with transparent textures and such. I say 'work' because it's quite buggy and odd looking, so I recommend not making pieces out of transparent blocks like Glass. Sorry!