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
Name | Type | Default | Description |
---|---|---|---|
slice_state | string | mcutils:slices | |
max_slices | number | 6 | |
nutrition | number | 2 | |
interactions | string[] | [] |
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"]
}
}
}
}