Skip to content

mcutils:crop

Vanilla crop block behavior.

Registering

Before you can use this component you need to register it.

js
import { system } from "@minecraft/server";
import { CropComponent } from "@lpsmods/mc-utils";

system.beforeEvents.startup.subscribe((event) => {
  event.blockComponentRegistry.registerCustomComponent(CropComponent.typeId, new CropComponent());
});

Component

Options

NameTypeDefaultDescription
growth_statestring
max_stagenumber7

Examples

Crop

json
{
  "format_version": "1.21.100",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:custom_crop",
      "states": {
        "mcutils:growth": [0, 1, 2, 3, 4, 5, 6, 7]
      }
    },
    "components": {
      "mcutils:crop": {
        "growth_state": "mcutils:growth",
        "max_stage": 7
      },
      "mcutils:fertilizable": {
        "growth_state": "mcutils:growth",
        "max_stage": 7
      }
    }
  }
}

Not associated with or approved by Mojang Studios or Microsoft