Adding A Custom Block Reward - TheTurkeyDev/ChanceCubes GitHub Wiki

Before you add a block reward, you need to have the basic reward setup. If you have not done that already, you need to head here to set up the base for the reward.

Fields:

Field Name Type Default Field Description
xOffSset Integer 0 The offset in the x direction from the location of the Chance Cube/Player for the block to be placed
yOffSset Integer 0 The offset in the y direction from the location of the Chance Cube/Player for the block to be placed
zOffSset Integer 0 The offset in the z direction from the location of the Chance Cube/Player for the block to be placed
block String minecraft:dirt Formatted mod:blockName:metadata(optional)
falling Boolean false True makes the block spawn slightly overhead and fall into position. False will spawn the block in normally where it is set to.
delay Integer 0 The delay for the block to wait after the Chance Cube is broken before spawning in.
relativeToPlayer Boolean false True makes the block spawn with the offset's based on the players position and not the Chance Cube. False does the opposite.
removeUnbreakableBlocks Boolean false Setting to true makes the reward place this block no matter what already exists in the current world location. False will not replace the block if the current block in the world is unbreakable or is marked as non replaceable.

Example:

{
	"Block_Reward": 
	{
		"chance": 0,
		"Block":
		[
			{"xOffSet":-1, "yOffSet":"%%RND(1,5)%%", "zOffSet":"%%RND(3)%%", "block":"%%[minecraft:dirt, minecraft:stone, minecraft:sand]%%", "falling":false, "delay":1, "relativeToPlayer":true, "removeUnbreakableBlocks":false}

		]
	}
} 

Config Tutorial:

Adding the block to the reward.

Blocks are one of the most versatile and fun rewards to play around with and add a very cool aspect to the rewards system. There are 5 values that are required with every block reward and 2 optional values as well to provide more functionality. First we will start off with creating the reward and adding the required info.

Step 1: Adding the Block Reward type:

In order to tell the mod that we want to add a the block reward type to the reward we need to add the Block tag. This is done by adding "Block": after either the comma after the chance value of the reward or the comma after the last reward type added. Once you have done that you need to add one opening and one closing square bracket after the colon. Again it is suggested to put these on separate lines for appearances sake. Your file should look something like this if you only have the Block reward added. If you have more reward types already added it may look differently.

Failed to load image: Block-Type.png

Do note that if you are planning to add more reward types to this reward after the block type, you need to add a comma after the closing sqaure bracket of your block reward type. If you are not planning to add another reward type then DO NOT add the comma as you reward will not work.

Step 2: Adding the Actual Block and Other Required Info:

Now that you have the block reward type added to your custom reward, you are now ready to add the required info that will actually spawn in the block. The first step to adding the info for the bloc is by adding one more set of opening and closing brackets between the opening and closed square brackets of the Block reward that you added earlier. Now between these brackets you will add out required info. First, you need add the offset location that the reward block will spawn relative to. This done by adding 3 things: XOffSet, YOffSet, and ZOffSet