Creoii Mod Documentation & Wiki
Lucky Block
Lucky Block
  • Overview
  • Installing Addons
  • Creating Addons
  • Upcoming Features
  • Outcomes
    • Outcomes
    • Advancement Outcome
    • Block Outcome
    • Command Outcome
    • Difficulty Outcome
    • Effect Outcome
    • Entity Outcome
    • Explosion Outcome
    • Feature Outcome
    • Group Outcome
    • Item Outcome
    • Message Outcome
    • None Outcome
    • Particle Outcome
    • Random Outcome
    • Sound Outcome
    • Structure Outcome
  • Parameters
    • Parameters
    • Parameter Index
  • Vec Providers
    • Vec Providers
    • Vec Provider Index
  • Shapes
    • Shapes
Powered by GitBook
On this page
  • Example
  • Id
  • Activations
  • Settings
  • Item Luck
  • Debug

Creating Addons

PreviousInstalling AddonsNextUpcoming Features

Last updated 4 months ago

To create a Lucky Block Addon, you must first create a new folder. Copy the following 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 ). 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:

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.

"resistance": 0.2

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

"rarity": "rare"

Defines the item rarity. See below for more information.

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

Outcomes
Logolucky_block/common/src/main/resources/data/lucky at main · jack-zisa/lucky_blockGitHub
Example Lucky Block Datapack Addon
LogoBreakingMinecraft Wiki
Block Hardness
LogoExplosionMinecraft Wiki
Block Blast Resistance
LogoRarityMinecraft Wiki
Item Rarity
Example Addon Folder Structure