Adding A Custom Command Reward - TheTurkeyDev/ChanceCubes GitHub Wiki

Before you add a command 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
command String /help The command to be executed when the Chance Cube is broken. You can use the dynamic variable %player to substitute for the players name to be inserted when the cube is broken. %x, %y and %z can be substituted for ~ to make the reward spawn relative to the broken block. Alternatively %px, %py and %pz can be substituted for ~ to spawn the reward relative to the player
delay Integer 0 The delay for the command to wait after the Chance Cube is broken before running

Example:

{
	"Command_Reward": 
	{
		"chance": 0,
		"Command":
		[
			{"command":"/give %player minecraft:painting 1 0 {display:{Name:\"Wylds Bestest friend\",Lore:[\"You know you love me, \"]}}", "delay": 5}
		]
	}
}

Config Tutorial:

The command reward is a fairly easy reward to setup. The first step is adding the command reward type identifier of

"Command": []

after either the chance value or the last reward that you added. Once that is done simply add

{"command":"FullCommand"}

between the square brackets of the command reward. After that simply replace FullCommand with your desired command and viola! You have added a command reward!