Skip to content

CandleCakeComponent Class

Makes this block behave like Cake with Candles

Parameters

NameTypeDefaultDescription
candleItemStringminecraft:candleThe candle item to drop
cakeBlockStringnubecraft:cakeThe cake block to convert
stateNameStringmorefood:litThe name of the lit state
sliceNameStringmorefood:sliceThe name of the slice state

Methods

onPlayerInteract

setLit

eat

hasLightable

Example

js
new CandleCakeComponent("minecraft:candle", "minecraft:cake", "lit", "slice");
json
{
  "format_version": "1.21.20",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:custom_candle_cake"
    },
    "component": {
      "minecraft:custom_components": ["wiki:custom_candle_cake"]
    }
  }
}

Not associated with or approved by Mojang Studios or Microsoft