1. Wiki
  2. /实体
  3. /minecraft:behavior.ocelotattack

minecraft:behavior.ocelotattack

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

概览

minecraft:behavior.ocelotattack 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 豹猫和猫使用的潜行扑击攻击。生物会悄悄靠近目标,然后冲刺并扑上去。

字段

字段类型默认值说明
cooldown_timenumber1两次攻击之间的秒数。
x_max_rotationnumber30生物看向目标时最多能上下仰俯的角度(度)。
y_max_head_rotationnumber30生物看向目标时头部最多能左右转动的角度(度)。
max_distancenumber15只有目标比这个距离更近时,生物才使用这种攻击。
max_sneak_rangenumber15在这个距离内,生物开始朝目标潜行。
max_sprint_rangenumber4在这个距离内,生物开始冲刺。冲刺优先于潜行。
reach_multipliernumber2与生物体型相乘,决定它要离多近才能击中。
sneak_speed_multipliernumber0.6潜行时的速度倍率。
sprint_speed_multipliernumber1.33冲刺时的速度倍率。
walk_speed_multipliernumber0.8在攻击范围内既不潜行也不冲刺、正常行走时的速度倍率。
priorityinteger0多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 …
control_flagsGoal's control flags[]无列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.ocelotattack": {
    "cooldown_time": 1,
    "x_max_rotation": 30,
    "y_max_head_rotation": 30,
    "max_distance": 15,
    "max_sneak_range": 15,
    "max_sprint_range": 4,
    "reach_multiplier": 2,
    "sneak_speed_multiplier": 0.6
  }
}

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