Skip to content

mcutils:cake

Vanilla cake block behavior.

Registering

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

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

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

Component

Options

NameTypeDefaultDescription
slice_statestringmcutils:slices
max_slicesnumber6
nutritionnumber2
interactionsstring[][]

Examples

Cake

json
{
  "format_version": "1.21.100",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:custom_cake",
      "states": {
        "mcutils:slice": [0, 1, 2, 3, 4, 5, 6]
      }
    },
    "components": {
      "mcutils:cake": {
        "slice_state": "mcutils:slice",
        "max_slices": 6,
        "interactions": ["candle->wiki:candle_cake"]
      }
    }
  }
}

Not associated with or approved by Mojang Studios or Microsoft