Skip to content

CakeComponent Class

Makes this block behave like Cake

Parameters

NameTypeDefaultDescription
stateNameStringmorefood:sliceThe name of the slices stage
maxSlicesNumber6The max number of slices

Methods

onPlayerInteract

placeCandle

eat

addCandleCake

Example

js
var cake = new CakeComponent("slice", 6);
cake.addCandleCake("minecraft:candle", "minecraft:candle_cake");
json
{
  "format_version": "1.21.20",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:custom_cake"
    },
    "component": {
      "minecraft:custom_components": ["wiki:custom_cake"]
    }
  }
}

Not associated with or approved by Mojang Studios or Microsoft