Creating Addons

To create a Lucky Block Addon, you must first create a new folder. Copy the following folder structure:

Example Addon Folder Structure

The lucky_block.json file in the root of your datapack (in the namespace directory) defines the actual addon. The "outcome" folder defines various drops (see Outcomes). Everything else is either vanilla assets or data.

A Lucky Block Addon can then be put inside of the "addons" folder in your game's run directory (typically .minecraft) to load it in game.

Example

To see an example Datapack Lucky Block Addon, see the following:

Example Lucky Block Datapack Addon
lucky_block.json
{
  "id": "lucky:lucky_block",  // required
  "activations": [            // optional
    "break_creative",
    "break_survival",
    "right_click",
    "power"
  ],
  "settings": {               // optional
    "hardness": 0.2,
    "resistance": 20.0,
    "rarity": "rare"
  },
  "item_luck": {              // optional
    "minecraft:diamond": 12,
    "minecraft:diamond_block": 100,
    "minecraft:emerald": 8,
    "minecraft:emerald_block": 80,
    "minecraft:gold_ingot": 6,
    "minecraft:gold_block": 60,
    "minecraft:iron_ingot": 3,
    "minecraft:iron_block": 30,
    "minecraft:golden_carrot": 30,
    "minecraft:golden_apple": 40,
    "minecraft:enchanted_golden_apple": 100,
    "minecraft:nether_star": 100,
    "minecraft:rotten_flesh": -5,
    "minecraft:spider_eye": -10,
    "minecraft:fermented_spider_eye": -20,
    "minecraft:poisonous_potato": -10,
    "minecraft:pufferfish": -20
  },
  "debug": true                // optional
}

Id

"id": "lucky:lucky_block"

The only required field is the "id" field. This defines the id of your lucky block addon, block, and item.

Activations

Activations determine how a Lucky Block is "opened" or "activated". This field is optional, and defaults to ["break_survival", "power"].

  • break_survival: lucky block activates when broken in survival

  • break_creative: lucky block activates when broken in creative

  • power: lucky block activates when powered by Redstone

  • right_click: lucky block activates when right-clicked

Settings

"settings": {
    "hardness": 0.2,
    "resistance": 20.0,
    "rarity": "rare"
}

An optional field which defines block & item settings.

"hardness": 0.2

Defines the block hardness. See below for more information.

Block Hardness
"resistance": 0.2

Defines the block blast resistance. See below for more information.

Block Blast Resistance
"rarity": "rare"

Defines the item rarity. See below for more information.

Item Rarity

Item Luck

"item_luck": {
    "minecraft:diamond": 12,
    "minecraft:diamond_block": 100,
    "minecraft:emerald": 8,
    "minecraft:emerald_block": 80,
    "minecraft:gold_ingot": 6,
    "minecraft:gold_block": 60,
    "minecraft:iron_ingot": 3,
    "minecraft:iron_block": 30,
    "minecraft:golden_carrot": 30,
    "minecraft:golden_apple": 40,
    "minecraft:enchanted_golden_apple": 100,
    "minecraft:nether_star": 100,
    "minecraft:rotten_flesh": -5,
    "minecraft:spider_eye": -10,
    "minecraft:fermented_spider_eye": -20,
    "minecraft:poisonous_potato": -10,
    "minecraft:pufferfish": -20
}

An optional field which defines values for luck crafting. Maps item ids to an integer value between -100 and 100.

Debug

Defaults to false, this field should be used when testing Lucky Blocks. When true, it will print messages in the console:

  • Outcome Id when activating a block

  • Outcome Ids when loading outcomes on world load

  • Lucky Block Ids during initial game load

Last updated