消耗品
行为为「消耗品」的类型(内置 CONSUMABLE,以及 父类型: CONSUMABLE 的自定义类型)可以设置 使用(英文 consumable),右键使用。
items/consumable.yml
HEALING_POTION:
名称: '&a生命药水'
材质: HONEY_BOTTLE
使用:
恢复生命: 20
恢复饱食: 4
恢复饱和: 2
消耗数量: 1
冷却秒: 10
冷却群组: potions
药水效果:
speed: {秒数: 10, 等级: 2}
regeneration: {秒数: 5, 等级: 1}
指令:
- {执行者: 控制台, 内容: 'say {player} 喝下了生命药 水'}
- {执行者: 玩家, 内容: 'spawn'}
音效:
- {名称: 'minecraft:entity.player.levelup', 音量: 1, 音高: 1.2}
English keys
HEALING_POTION:
name: '&a生命药水'
material: HONEY_BOTTLE
consumable:
heal: 20
food: 4
saturation: 2
amount: 1
cooldown: 10
cooldown-group: potions
potion-effects:
speed: {seconds: 10, level: 2}
regeneration: {seconds: 5, level: 1}
commands:
- {executor: CONSOLE, command: 'say {player} 喝下了生命药水'}
- {executor: PLAYER, command: 'spawn'}
sounds:
- {name: 'minecraft:entity.player.levelup', volume: 1, pitch: 1.2}
| 字段 | 范围 | 说明 |
|---|---|---|
恢复生命 / heal | ≥ 0 | 恢复的生命值 |
恢复饱食 / food | 0 – 20 | 饱食度 |
恢复饱和 / saturation | 0 – 20 | 饱和度 |
消耗数量 / amount | 1 – 64 | 每次使用消耗几个 |
冷却秒 / cooldown | ≥ 0 | 冷却秒数 |
冷却群组 / cooldown-group | 文字 | 相同群组共用冷却;默认是物品 ID |
药水效果 / potion-effects | — | 效果 ID(原版英文,如 speed): 秒数(0 – 86400)、 |