Daniel S. Rodriguez C.

The current mechanic is working perfectly. It correctly grows coral blocks matching the source coral's type in valid/replaceable adjacent blocks. Now modify the growth behaviour so that not every valid adjacent position necessarily grows coral. For each of the 6 adjacent positions (up, down, north, south, east, west), run an independent random roll to decide whether that position grows or remains unchanged.

  1. If the position is valid/replaceable (water, air, kelp, seagrass, or other appropriate replaceable underwater vegetation), roll independently to determine whether coral grows there.
  2. If the roll succeeds, replace that block with a coral block matching the source coral's type/variant.
  3. If the roll fails, leave the position unchanged.

This should result in coral growing on some, all, or none of the valid adjacent positions, chosen randomly each time bone meal is used. This is for Minecraft Java Edition 26.2.

Thnak you so much!!!

Kodari AI
KodariSep 6 at 9:04 pm 2
  1. Rebuild the missing coral-growth functions and preserve the existing bone-meal advancement flow.

  2. Add raycast/source-variant handling plus a replaceable underwater block tag.

  3. Replace all-adjacent placement with six independent 50% random rolls for every coral variant.

  4. Package everything under a correctly structured coral_growth_datapack/ folder with pack metadata and load registration.

Implemented the coral growth change in coral_growth_datapack/.

  • Each of the six adjacent directions now performs an independent 50% random roll.

  • Successful rolls replace valid blocks with the matching coral type.

  • Failed rolls leave blocks unchanged.

  • Supports live and dead coral block variants.

  • Valid targets include water, air, bubble columns, kelp, seagrass, and tall seagrass.

  • Uses Minecraft Java Edition pack format 48.

Installation:

  1. Download the ZIP using the export button.

  2. Extract coral_growth_datapack into your world’s world/datapacks/ folder.

  3. Run /reload.

  4. Verify it loaded with /datapack list.

  5. Test with /function coral_growth:detect if needed.

Kodari can make mistakes. Review important code before using.
Files
coral_growth_datapack
Code
20 141
coral_growth_datapack/data/coral_growth/function/source.mcfunction
execute if block ~ ~ ~ minecraft:tube_coral_block run function coral_growth:grow_tube
execute if block ~ ~ ~ minecraft:brain_coral_block run function coral_growth:grow_brain
execute if block ~ ~ ~ minecraft:bubble_coral_block run function coral_growth:grow_bubble
execute if block ~ ~ ~ minecraft:fire_coral_block run function coral_growth:grow_fire
execute if block ~ ~ ~ minecraft:horn_coral_block run function coral_growth:grow_horn
execute if block ~ ~ ~ minecraft:dead_tube_coral_block run function coral_growth:grow_dead_tube
execute if block ~ ~ ~ minecraft:dead_brain_coral_block run function coral_growth:grow_dead_brain
execute if block ~ ~ ~ minecraft:dead_bubble_coral_block run function coral_growth:grow_dead_bubble
execute if block ~ ~ ~ minecraft:dead_fire_coral_block run function coral_growth:grow_dead_fire
execute if block ~ ~ ~ minecraft:dead_horn_coral_block run function coral_growth:grow_dead_horn