Updated:

Cake: item ID and commands

The ID for Cake is minecraft:cake. It is a placeable block, so the same ID works in /give, /setblock and /fill. The ID has been the same since Java 1.13.

Basic data

NameCake
ID (Java Edition)minecraft:cake
TypeBlock (also an item)
Java versionsJava 1.13 to 26.3
Bedrock 26.52Same ID works (tested on a server)
Stack size1
Hardness0.5
Blast resistance0.5

Commands you can copy

Java Edition

Give one

/give @p minecraft:cake 1

Place at your feet

/setblock ~ ~ ~ minecraft:cake

Fill a 5×5 floor

/fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 minecraft:cake

Remove from inventory

/clear @p minecraft:cake

Open this command in the Give generator

Bedrock Edition

Give one

/give @p cake 1

Place at your feet

/setblock ~ ~ ~ cake

Remove from inventory

/clear @p cake

How to make it

Unlock the recipe

/recipe give @p minecraft:cake

Recipes come from the official Java 26.3 data. Some ingredients differ on Bedrock.

Block states

StateValuesDefault
bites0, 1, 2, 3, 4, 5, 60

Place it with a state

/setblock ~ ~ ~ minecraft:cake[bites=1]

Bedrock uses different state names and syntax (for example ["facing_direction"=2]).

Version notes

This ID has not changed from Java 1.13 to the latest 26.3.

Java 1.20.5 and later write extra item data in [ ] (components); 1.20.4 and earlier use { } (NBT). A plain /give with only the ID is the same in both.

Questions

What is the ID for Cake?

It is minecraft:cake. In commands you can also write cake without minecraft:.

Why does the command turn red?

Check the spelling first. The Command Error Doctor can check it.

Related IDs