Skip to content

Adding Crystal Apothecary Harvestables

DaFuqs edited this page Apr 5, 2023 · 7 revisions

The Crystal Apothecary is a functional block that automatically harvests blocks in it's vicinity. Making blocks harvestable is as simple as adding them to the spectrum:crystal_apothecary_harvestable block tag. There is another functionality to the Crystal Apothecary, though: It can simulate block growth in unloaded chunks (mainly intended, but not limited to for gemstone cluster type blocks). Whenever a Crystal Apothecary get's loaded it checks how long it was unloaded, checks it's surroundings and tries to estimate, for example, how much Amethyst would have been grown in a geode, based on the amount of budding blocks & blocks next to them that match certain criteria (where Amethyst Clusters could grow).

You can specify additional simulations, or edit existing ones, by placing json files in the directory: <data_pack_or_mod_name>/crystal_apothecary_simulations.

Properties:

  • budding_block (Block ID): The id of a block that should be searched around of
  • valid_neighbor_blocks (List of Block IDs): List of blocks that should be counted next to each budding_block
  • ticks_for_compensation_loot_per_valid_neighbor (int): The amount of ticks per found valid block it takes to generate compensation loot. Adjusted to match the randomTickTime-gamerule. Vanilla Amethyst roughly grows a finished Cluster every ~10.000 ticks with default randomTickTime of 3
  • compensated_loot (Item ID + count + nbt): The item to give

Growth Estimates (ticks_for_compensation_loot_per_valid_neighbor)

For Vanillas Amethyst:

  • There are /gamerule randomTickTime random ticks in each 161616 cube per game tick (default: 3)
  • When a budding block it ticked, there is a 20% chance to choose a random direction and check if a bud can grow/advance at that pos
  • Vanilla's and Spectrum's Buds all have 4 growth stages to get fully grown

This results in

  • (<randomTickSpeed> / 16*16*16) * empty_blocks_next_to_budding_blocks * grow_chance * (1 / growth_stage_count) average grown clusters per tick.
  • => ~10.000 ticks per budding block

Example: Allowing the Crystal Apothecary to harvest Topaz

{
  "budding_block": "minecraft:budding_amethyst",
  "valid_neighbor_blocks": [
    "minecraft:small_amethyst_bud",
    "minecraft:medium_amethyst_bud",
    "minecraft:large_amethyst_bud",
    "minecraft:amethyst_cluster",
    "minecraft:air",
    "minecraft:cave_air",
    "minecraft:water"
  ],
  "ticks_for_compensation_loot_per_valid_neighbor": 10000,
  "compensated_loot": {
    "item": "minecraft:amethyst_shard",
    "count": 2
  }
}
Clone this wiki locally