1. Wiki
  2. /物品
  3. /minecraft:use_modifiers

minecraft:use_modifiers

不想手写?在 GodCraft 里打开一个开关,就能帮你设置好 minecraft:use_modifiers。Get GodCraft

概览

minecraft:use_modifiers 是一个物品组件:写在自定义物品的 components 对象中。 控制按住使用键时的表现:一次使用需要多长时间,以及期间玩家走得多慢。食物、药水和弓都需要它。

字段

字段类型默认值说明
start_usingStartUsing"if_first"是只在没有其他使用时才开始("if_first"),还是每次都重新开始("always")。
use_durationnumber0物品完成使用所需的秒数,比如吃东西的时间。范围:0 到 …
emit_vibrationsbooleantrue为 true 时,开始和停止使用会产生幽匿感测体能听到的振动。
start_soundLevelSoundEvent无玩家开始使用物品时播放的声音。
movement_modifiernumber无使用时的行走速度:1 为正常速度,0.35 是吃东西时的慢速。范围:0 到 1

示例

写在 BP/items/<name>.json 的 components 对象中(值为默认值或占位值):

BP/items/<name>.json
{
  "minecraft:use_modifiers": {
    "start_using": "if_first",
    "use_duration": 0,
    "emit_vibrations": true,
    "start_sound": {},
    "movement_modifier": 0
  }
}

物品: 行为包

We use cookies to improve your experience and analyse site traffic. Learn more