烟翎阁minetools.cn · MC Java 工具

蛋糕指令

minecraft:cake英文名 Cake

蛋糕(minecraft:cake)不能堆叠,一格只能放 1 个。下面是常用的给予、放置、清除和检测命令,点“复制”就能用。

常用命令

给最近的玩家 1 个蛋糕
/give @p minecraft:cake
给所有玩家
/give @a minecraft:cake
金色的名字
/give @p cake[custom_name={translate:"block.minecraft.cake",color:"gold",italic:false}]

想换成自己起的名字,把 translate 那段改成普通文字

在脚下放一个
/setblock ~ ~ ~ minecraft:cake
铺一片 5×5
/fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 minecraft:cake

会替换脚下那一层方块

清除玩家身上所有蛋糕
/clear @p minecraft:cake
检测手里是否拿着蛋糕
/execute as @a if items entity @s weapon.mainhand minecraft:cake run title @s actionbar ["",{text:"✔ ",color:"green"},{translate:"block.minecraft.cake"}]
在物品生成器里编辑(名字、附魔、属性……)

基本信息

物品 ID
minecraft:cake
最大堆叠
1
类型
方块(可以放置)

数据来自 Minecraft Java 26.3 官方数据,命令都经过 26.3 语法检查。