Minecraft Wiki

除另有声明,转载时均必须注明出处若簡繁轉換出錯,請以遊戲內為準请勇于扩充与修正内容有兴趣逛逛我们的微博沟通交流,欢迎到社区专页需要协助,请在告示板留言

了解更多

Minecraft Wiki
Advertisement
Information icon
此特性为基岩版独有。
Ic translate
此条目的(部分)内容需要翻译。

你可以帮助我们来翻译此条目,但请勿使用机器翻译

Template:Bedrock Edition Developer Documentation

版本

适用于基岩版beta 1.10.0.3

该文档是针对基岩版的beta版本的。在此版本中的新特性、组件和兼容性并未最终决定,在最终版文档发布前该文档如有变更,将不会另行通知。

如果您的附加包无法正常工作,请确保文档正式发布后再次查看该文档。该文档对在beta版本中制作的资源包和行为包在最终版中能正常运行不作担保。

AI标识

minecraft:behavior.avoid_mob_type

允许此实体避开特定类型的生物。

参数
类型 名称 默认值 描述
JSON对象 entity_types 此生物要避开的实体类型的列表。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表中的条目生效的条件。
小数 max_dist 16 此生物逃避的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,此生物可以以隐形的方式逃避。
布尔值 must_see_forget_duration 3.0 此生物忘记当前逃避目标和目标不再隐形时寻找新逃避目标的秒数。
小数 max_dist 0.0 寻找逃避实体的最大距离。
小数 max_flee 0.5 生物作出停止逃避决定时与待逃避生物的格数。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表保持原来的速度,更高的值代表走得更快。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表保持原来的速度,更高的值代表跑得更快。
小数 probability_per_strength 1.0 此生物决定停止逃避另一实体所需的强度。
布尔值 ignore_visibility false 若为true,将不会检查此生物是否看见待逃避的生物。

minecraft:behavior.beg

允许此生物看着并跟着拿着它们喜欢的食物的玩家。

参数
类型 名称 默认值 描述
List items 此生物喜欢的食物的列表。
小数 look_distance 8.0 此生物要食物的距离(格)。
范围 [a, b] look_time [2, 4] 此生物盯着拿着它们喜欢的食物玩家并向其要食物的时间范围。

minecraft:behavior.break_door

允许此生物破门。

minecraft:behavior.stomp_turtle_egg

允许此生物踩海龟蛋。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 当AI执行此目标时的移动速度乘数。
整数 search_range 0 搜索要前去踩的海龟蛋的范围的距离。
整数 search_height 1 搜索要前去踩的海龟蛋的范围的高度。
整数 search_count 10 每刻在搜索范围内搜索可到达的方块的数量。0表示此生物每刻检查1个方块。
小数 goal_radius 0.5 决定完成目标的距离(格)。此属性是停止AI为了踩海龟蛋而蹦蹦跳跳所作出的回旋空间。
整数 interval 120 决定何时随机移动的随机值。有1/interval(此值)的几率选择此目标。

minecraft:behavior.breed

允许此生物与其它生物繁殖。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 当AI执行此目标时的移动速度乘数。

minecraft:behavior.charge_held_item

允许此生物使用它们手持的物品,包含冷却时间。

参数
类型 名称 默认值 描述
List items 此生物能够使用它们手持的物品的列表。

minecraft:behavior.defend_village_target

允许生物留在村庄里并与视村民为敌对的生物战斗。

参数
类型 名称 默认值 描述
JSON对象 entity_types 此生物认为是村庄威胁的实体类型列表。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目生效的条件。
小数 max_dist 16 此生物可执行此目标的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,生物必须看到敌对生物才能执行此目标。
布尔值 must_see_forget_duration 3.0 决定忘记当前目标以及目标看不见时寻找新目标之间的间隔秒数。

minecraft:behavior.door_interact

允许生物开门和关门。

minecraft:behavior.eat_block

允许生物吃掉一个方块(如羊吃草)。

参数
类型 名称 默认值 描述
Trigger on_eat 触发生物吃掉一个草方块的触发器。

minecraft:behavior.explore_outskirts

允许生物探索村庄外围区域。

参数
类型 名称 默认值 描述
整数 wait_time 0 生物停止并寻找新POI的时间。
小数 explore_dist 5.0 生物可越过村庄边界多远。
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。

minecraft:behavior.flee_sun

允许生物避开阳光直射和寻找阴影庇护。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 执行此AI标识时的速度乘数。

minecraft:behavior.float

允许生物能浮在水面上。

minecraft:behavior.follow_owner

允许生物跟随其主人。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
小数 start_distance 10.0 生物跟随其主人前最远与主人的距离(格)。
小数 stop_distance 2.0 生物停止跟随其主人前与主人的距离(格)。

minecraft:behavior.follow_parent

允许生物跟随在其父母周围。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。

minecraft:behavior.follow_caravan

允许生物跟随商队里的生物。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 entity_count 1 商队里可拥有的实体数量。
JSON对象 entity_types 此生物会跟随的在商队里的实体类型。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目有效的条件。
小数 max_dist 16 可执行此目标的最远距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,生物必须看见该实体类型才能执行此目标。
布尔值 must_see_forget_duration 3.0 忘记当前目标前和目标不再可见时寻找新目标的间隔秒数。

minecraft:behavior.follow_mob

允许此生物跟随其它生物。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识的移动速度乘数。
小数 stop_distance 2.0 生物停止跟随时与另一生物的距离(格)。
整数 search_range 0 生物搜索要跟随的生物的距离(格)。

minecraft:behavior.go_home

允许此生物回到其出生点。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 interval 120 一个决定何时随机移动的随机值。有1/interval(此值)的几率选择此目标。
小数 goal_radius 0.5 生物认为其已完成目标的距离(格)。此属性是防止AI为了去某个点而蹦蹦跳跳所作出的回旋空间。
字符串 on_home 此生物回到家后触发的事件。

minecraft.behavior.scared

允许生物在雷暴时害怕。

参数
类型 名称 默认值 描述
整数 sound_interval 0 雷暴音效播放时1/delay几率激活此目标的间隔。

minecraft:behavior.move_to_water

允许此生物上岸时回到水里。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 search_range 0 此生物搜索要移动到的水的搜索距离(格)。
整数 search_height 1 此生物搜索要向上移动到的水的搜索高度(格)。
整数 search_count 10 此生物每刻检查在搜索范围内的可移动的有效的方块的数量。0代表每刻检查搜索范围内的1个方块。
小数 goal_radius 0.5 此生物认为目标已完成的距离。此属性是为了防止AI为了去某个点而蹦蹦跳跳所作出的回旋空间。

minecraft:behavior.move_to_land

允许此生物在水里时回到岸上。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 search_range 0 此生物搜索要移动到的陆地的搜索距离(格)。
整数 search_height 1 此生物搜索要向上移动到的陆地的搜索高度(格)。
整数 search_count 10 此生物每刻检查在搜索范围内的可移动的有效的方块的数量。0代表每刻检查搜索范围内的1个方块。
小数 goal_radius 0.5 此生物认为目标已完成的距离。此属性是为了防止AI为了去某个点而蹦蹦跳跳所作出的回旋空间。

minecraft.behavior.move_to_poi

允许生物在可能的情况下移动到一个POI。

参数
类型 名称 默认值 描述
字符串 poi_type 指定生物要寻找的POI类型。
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。

minecraft.behavior.work

允许村民使用它们的工作场所POI。

参数
类型 名称 默认值 描述
整数 sound_delay_min 0 音效在1/delay几率激活时播放的最小间隔。
整数 sound_delay_max 0 音效在1/delay几率激活时播放的最大间隔。
整数 goal_cooldown 0 此目标在能够被再次使用前的冷却时间(刻)。
整数 active_time 0 NPC留在工作地点的时间长度(刻)。

minecraft:behavior.random_breach

允许生物随机打破水面。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 xz_dist 10 生物搜索岸上新移动目标点的搜索距离(格),此值最小为1。
整数 y_dist 7 生物搜索新移动目标点的搜索距离(格),此值最小为1。
整数 interval 120 决定何时随机移动的一个随机值。这有1/interval的几率选择此目标。
小数 cooldown_time 0.0 生物能够再次使用此目标前的冷却时间(秒)。

minecraft:behavior.nearest_attackable_target

允许生物检查并追赶距离最近的有效目标。

参数
类型 名称 默认值 描述
JSON对象 entity_types 此生物认为是有效目标的实体类型。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目有效的条件。
小数 max_dist 16 此生物可执行此目标的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,此生物看见目标时才能执行此目标。
布尔值 must_see_forget_duration 3.0 生物决定在忘记当前目标前和目标不再可见时到寻找新目标之间所间隔的时间(秒)。
小数 within_radius 0.0 生物可对目标发动攻击的距离(格)。
整数 attack_interval 0 攻击之间得到间隔时间(秒)。
布尔值 must_see false 若为true,目标在此生物视野时才能执行此目标。
小数 must_see_forget_duration 3.0 生物决定在忘记当前目标前和目标不再可见时到寻找新目标之间所间隔的时间(秒)。
布尔值 must_reach false 若为true,该实体是此生物唯一可选择、可移动到的目标。
布尔值 reselect_targets false 若为true,在其它实体靠得更近时,目标会变为这个更靠近的生物。
整数 scan_interval 10 扫描目标之间的间隔时间(刻)。
小数 target_search_height -1.0f 搜索目标生物的搜索高度(格)。-1.0f代表不重要。
小数 persist_time 0.0f 在目标成为无效目标时此生物仍将其当作目标的时间(秒)。

minecraft:behavior.hurt_by_target

允许生物把对它造成伤害的生物标记为目标。

参数
类型 名称 默认值 描述
JSON对象 entity_types 此生物可以标记为目标的实体列表。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目有效的条件。
小数 max_dist 16 此生物可执行此目标的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,此生物必须看见此实体才能执行此目标。
布尔值 must_see_forget_duration 3.0 生物决定在忘记当前目标前和目标不再可见时到寻找新目标之间所间隔的时间(秒)。
布尔值 alert_same_type false 若为true,附近相同类型的生物都会收到这次伤害的警告。
布尔值 hurt_owner false 若为true,此生物会攻击这个实体和这个实体的主人。

minecraft:behavior.owner_hurt_by_target

允许生物标记其它对其主人造成伤害的生物。

参数
类型 名称 默认值 描述
JSON对象 entity_types 此生物可以标记的实体的列表。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目有效的条件。
小数 max_dist 16 此生物可执行此目标的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,此生物必须看见此实体才能执行此目标。
布尔值 must_see_forget_duration 3.0 生物决定在忘记当前目标前和目标不再可见时到寻找新目标之间所间隔的时间(秒)。

minecraft:behavior.owner_hurt_target

允许生物标记被其主人攻击的实体。

参数
类型 名称 默认值 描述
JSON对象 entity_types 如果潜在的目标实体被此生物的主人攻击,此生物可以标记的实体的列表。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目有效的条件。
小数 max_dist 16 此生物可执行此目标的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,此生物必须看见此实体才能执行此目标。
布尔值 must_see_forget_duration 3.0 生物决定在忘记当前目标前和目标不再可见时到寻找新目标之间所间隔的时间(秒)。

minecraft:behavior.lay_egg

允许生物在怀孕时在沙子上下蛋。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 search_range 0 搜索要去到的沙子方块的搜索距离(格)。
整数 search_height 1 搜索要去到的沙子方块的搜索高度(格)。
整数 search_count 10 此生物在其搜索范围里检查可去到的方块的检查数量。0代表此生物每刻检查1个方块。
小数 goal_radius 0.5 此生物认为其已完成目标的距离(格)。此属性是为了防止生物为了去到某个点而蹦蹦跳跳所作出的回旋空间。
字符串 on_lay 生物下蛋时触发的事件。

minecraft:behavior.look_at_player

允许生物附近有玩家时看着玩家。

参数
类型 名称 默认值 描述
小数 look_distance 8.0 生物会看着玩家的距离(格)。
小数 probability 0.02 看向目标的几率。1.00值的几率是100%。
范围 [a, b] look_time [2, 4] 看向实体的时间范围。
整数 angle_of_view_vertical 360 生物在X轴(左右方向)上可看见玩家的角度。
整数 angle_of_view_horizontal 360 生物在Y轴(上下方向)上可看见玩家的角度。

minecraft:behavior.look_at_target

允许生物看着被它们标记的目标。

参数
类型 名称 默认值 描述
小数 look_distance 8.0 生物会看着实体的距离(格)。
小数 probability 0.02 看向目标的几率。1.00值的几率是100%。
范围 [a, b] look_time [2, 4] 看向实体的时间范围。
整数 angle_of_view_vertical 360 生物在X轴(左右方向)上可看见实体的角度。
整数 angle_of_view_horizontal 360 生物在Y轴(上下方向)上可看见实体的角度。

minecraft:behavior.look_at_entity

允许生物看着它们附近的实体。

参数
类型 名称 默认值 描述
小数 look_distance 8.0 生物会看着实体的距离(格)。
小数 probability 0.02 看向目标的几率。1.00值的几率是100%。
范围 [a, b] look_time [2, 4] 看向实体的时间范围。
整数 angle_of_view_vertical 360 生物在X轴(左右方向)上可看见实体的角度。
整数 angle_of_view_horizontal 360 生物在Y轴(上下方向)上可看见实体的角度。
Minecraft过滤器 filters 决定生物会看向何种实体的过滤器。

minecraft:behavior.look_at_trading_player

允许生物看着与它们交易的目标。

参数
类型 名称 默认值 描述
小数 look_distance 8.0 生物看着目标的距离(格)。
小数 probability 0.02 看向目标的几率。1.00表示100%。
范围 [a, b] look_time [2, 4] 看向实体的时间范围。
整数 angle_of_view_vertical 360 生物在X轴(左右方向)上可看见实体的角度。
整数 angle_of_view_horizontal 360 生物在Y轴(上下方向)上可看见实体的角度。

minecraft:behavior.mount_pathing

允许生物自行游荡寻找攻击目标。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
小数 target_dist 0.0 生物自行离开目标时的距离。
布尔值 track_target false 若为true,在目标变成有效目标后,此生物会追逐它。

minecraft:behavior.move_indoors

此标志只能被村民使用。允许村民寻找室内庇护。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。

minecraft:behavior.move_through_village

只能被村民使用。允许村民创建环绕村庄的路径。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
布尔值 only_at_night false 若为true,此生物只会在夜间的村庄里走动。

minecraft:behavior.move_towards_restriction

允许守卫者、铁傀儡和村民走进预定义的限制行动范围。其它生物没有限制。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。

minecraft:behavior.move_towards_target

允许生物移向其当前目标。

参数
类型 名称 默认值 描述
小数 within_radius 0.0 定义生物尝试移动到与目标指定的距离(格)。0代表此生物会尝试把相同方块当作目标占据。

minecraft:behavior.ocelotattack

只能被豹猫使用。允许豹猫潜行然后发动突然攻击。

参数
类型 名称 默认值 描述
小数 walk_speed_multiplier 1.0 攻击时的移动速度乘数。
小数 sprint_speed_multiplier 1.0 攻击时的跑步速度乘数。
小数 sneak_speed_multiplier 1.0 潜行速度乘数。1.0代表豹猫会以正常速度潜行。

minecraft:behavior.ocelot_sit_on_block

允许生物像豹猫那样原地坐下。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。

minecraft:behavior.lay_down

允许生物趴下。

参数
类型 名称 默认值 描述
整数 interval 120 决定哪个interval出现的一个随机值。有1/interval的几率选择此目标。
整数 random_stop_interval 120 此目标可转化为行为时的一个随机值。有1/interval的几率播放音效。

minecraft:behavior.offer_flower

允许生物像铁傀儡那样给玩家送花。

minecraft:behavior.open_door

允许生物打开开门。需要生物有通过门的路径,否则生物不会尝试开门。

参数
类型 名称 默认值 描述
布尔值 close_door_after true 若为true,生物打开门走过后把门关上。

minecraft:behavior.panic

允许生物处于恐慌状态。生物恐慌时会逃离伤害源。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
布尔值 ignore_mob_damage false 若为true,生物不会因其它生物受到伤害而恐慌(只在接触火/熔岩后恐慌)。
布尔值 prefer_water false 若为true,生物会倾向于走进岸上的水里。
布尔值 force false 若为true,此生物的恐慌状态会持续至其不能移动或此目标被移除。

minecraft:behavior.run_around_like_crazy

允许生物四处闲逛。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。

minecraft:behavior.restrict_sun

允许生物在晴天时自动避开阳光直射。

minecraft:behavior.restrict_open_door

允许生物在夜晚呆在室内。

minecraft:behavior.random_look_around

允许生物随便看看。

参数
类型 名称 默认值 描述
范围 [a, b] look_time [2, 4] 生物的目光停留在某个随机方向的时间范围(秒)。

minecraft:behavior.silverfish_merge_with_stone

允许生物像蠹虫那样钻进石头里。此目标目前只能被蠹虫使用。

minecraft:behavior.silverfish_wake_up_friends

允许生物叫附近藏在方块里的生物出来。此目标只能被蠹虫使用。

minecraft:behavior.stay_while_sitting

允许生物安静地坐着而不会做其它事情。

minecraft:behavior.make_love

允许村民寻找配偶以生成其它村民。此标识只能被村民使用。

minecraft:behavior.snacking

允许生物卸下物品然后潜行到它找到的食物那里。

参数
类型 名称 默认值 描述
小数 snacking_cooldown 7.5 生物两次潜行之间的冷却时间(秒)。
小数 snacking_cooldown_min 0.5f 生物两次潜行之间的最小冷却时间(秒)。
小数 snacking_stop_chance 0.0017 生物停止潜行的几率。此值范围为0-1。
List items 生物感兴趣而潜行的物品。

minecraft:behavior.random_sitting

允许生物随机坐下一段时间。

参数
类型 名称 默认值 描述
小数 start_chance 0.1 生物开始坐着的几率。值范围为0-1。
小数 stop_chance 0.3 生物停止坐着的几率。值范围为0-1。
小数 cooldown_time 0.0 此标识可用前的冷却时间(秒)。
小数 min_sit_time 10 生物坐着的最短时间(秒)。

minecraft:behavior.melee_attack

允许生物使用近战攻击。

参数
类型 名称 默认值 描述
小数 melee_fov 90.0 用于决定是否可以发动有效的近战攻击所允许的FOV。
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
布尔值 track_target false 若为true,在目标变成有效目标后,此生物会追踪它。
字符串 attack_types 定义此生物要攻击的实体类型。
整数 random_stop_interval 0 定义生物停止战斗的可能性。值为0代表不会随机停止攻击,1代表有50%的几率停止攻击。
小数 reach_multiplier 2.0 生物近战够得着目标的乘数。(该属性用于模拟生物的手臂,此值越大,生物的手臂越长)
布尔值 attack_once false 若为true,此生物只攻击一次。
布尔值 require_complete_path false 若为true,此生物只会在它能接近目标时激活此标识。

minecraft:behavior.stomp_attack

允许生物使用北极熊的近战攻击。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
布尔值 track_target false 若为true,此生物会在目标变成有效目标时追逐。
字符串 attack_types 定义此生物会攻击的实体类型。
整数 random_stop_interval 0 定义生物停止攻击的可能性。0表示不会随意停止攻击,1表示有50%的几率停止攻击。
小数 reach_multiplier 2.0 生物够得着目标的乘数(此属性用于模拟生物的手臂,此值越大,手臂越长)。
布尔值 attack_once false 若为true,此生物只会攻击1次。
布尔值 require_complete_path false 若为true,此标识只在生物能够接近其目标时触发。

minecraft:behavior.ranged_attack

允许生物使用类似于射箭那样的范围攻击。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
小数 ranged_fov 90.0 用于决定是否可以进行有效的范围攻击的允许FOV。
整数 burst_shots 1 生物每次使用范围攻击的射击次数。
小数 burst_interval 0.0 每次射击之间的冷却时间。
整数 attack_interval_min 0 实体发动下次攻击前的最小等待时间。
整数 attack_interval_max 0 实体发动下次攻击前的最大等待时间。
小数 attack_radius 0.0 生物攻击目标的最远距离。如果目标超过此距离,生物会在攻击前移动。
小数 charge_charged_trigger 0.0 生物发出会心一击的所需时间(刻)。
小数 charge_shoot_trigger 0.0 生物开始准备填充一个攻击栏的最小时间(刻)。如要开启射击,此值必须大于0。

minecraft:behavior.random_stroll

允许生物四处闲逛。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 xz_dist 10 生物在水平面内寻找新的移动目标点的范围(格)。此值至少为1。
整数 y_dist 7 生物寻找新的移动目标点的高度范围(格)。此值至少为1。
整数 interval 120 用于决定何时随机移动的随机值。有1/interval的几率选择此标识。

minecraft:behavior.random_swim

允许实体在水中随机移动。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 xz_dist 10 生物寻找新的移动目标点的水平搜索距离。必须至少为1。
整数 y_dist 7 生物寻找新的移动目标点的垂直搜索距离。必须至少为1。
整数 interval 120 用于决定何时随机移动的一个随机值。有1/interval的几率选择此标识。

minecraft:behavior.random_fly

允许生物随机在空中飞行。

参数
类型 名称 默认值 描述
整数 xz_dist 10 生物寻找新的移动目标点的水平搜索距离。必须至少为1。
整数 y_dist 7 生物寻找新的移动目标点的垂直搜索距离。必须至少为1。
布尔值 can_land_on_trees true 若为true,生物可以降落在树上而不是地上。

minecraft:behavior.swim_wander

鱼在找不到路径时会随机游动。

参数
类型 名称 默认值 描述
小数 speed_multiplier 10 实体的速度。

minecraft:behavior.tempt

允许生物会受到它们喜欢的食物的诱惑。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
List items 此生物喜欢的食物。
布尔值 can_get_scared false 若为true,玩家在此生物附近移动得太快时不会受到诱惑。
小数 within_radius 0.0 生物会受到手持食物玩家的诱惑的距离(格)。

minecraft:behavior.trade_interest

允许生物看着拿着可交易物品的玩家。

参数
类型 名称 默认值 描述
小数 within_radius 0.0 此生物对玩家手上的物品感兴趣的距离(格)。
小数 interest_time 45.0 交易者对该交易物品感兴趣的最长时间(秒)。
小数 remove_item_time 1.0 当玩家不再有可交易物品时交易者的最长等待时间。
小数 carried_item_switch_time 2.0 交易者在尝试用不同的物品达成相同的交易之前它拿着那个物品的最长时间(秒)。
小数 cooldown 2.0 交易者使用此标识之前的冷却时间(秒)。

minecraft:behavior.peek

允许生物偷看。此标识在潜影贝看贝壳外面时使用

minecraft:behavior.play

允许生物与其它小村民玩耍。此标识只能由村民使用。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。

minecraft:behavior.receive_love

允许村民停下以便其它村民能与其繁殖。只能被村民使用。

minecraft:behavior.take_flower

只能被村民使用。允许生物收下铁傀儡送的花。

minecraft:behavior.harvest_farm_block

允许村民在附近的耕地中收获作物。只能被村民使用。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。

minecraft:behavior.squid_idle

允许鱿鱼原地打转。只能被鱿鱼使用。

minecraft:behavior.squid_flee

允许鱿鱼自由游动。只能被鱿鱼使用。

minecraft:behavior.squid_move_away_from_ground

允许鱿鱼离开陆地回到水上。只能被鱿鱼使用。

minecraft:behavior.squid_out_of_water

允许鱿鱼不在水中时留到地上。只能被鱿鱼使用。

minecraft:behavior.squid_dive

允许鱿鱼潜到水底。只能被鱿鱼使用。

minecraft:behavior.skeleton_horse_trap

允许马成为陷阱马,并拥有与陷阱马类似的触发机制,于玩家在附近时生成一个闪电球并生成一群马。只能被马、驴、骡和骷髅马使用。

参数
类型 名称 默认值 描述
小数 duration 1.0 陷阱存在的秒数。过了这个时间后,如陷阱未被激活则会被移除。
小数 within_radius 0.0 玩家触发陷阱马的距离(格)。

minecraft:behavior.sleep

允许生物在村庄里有一张床并睡上去。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
小数 cooldown_time 0.0 生物使用此标识之前的冷却时间(秒)。
小数 sleep_collider_height 1.0 生物睡觉时的碰撞箱高度。
小数 sleep_collider_width 1.0 生物睡觉时的碰撞箱宽度。
小数 sleep_y_offset 1.0 生物睡觉时的碰撞箱Y偏移。

minecraft:behavior.swell

允许爬行者在附近有玩家时爆炸。只能被爬行者使用。

参数
类型 名称 默认值 描述
小数 start_distance 10.0 此生物在目标处于特定距离时开始爆炸。
小数 stop_distance 2.0 此生物在目标处于特定距离时停止爆炸。

minecraft:behavior.dragonholdingpattern

允许龙围绕中央平台以圆形轨迹飞行。只能被末影龙使用。

minecraft:behavior.dragonlanding

允许龙停止飞行并过渡到栖息模式。只能被末影龙使用。

minecraft:behavior.dragonscanning

允许龙处于栖息模式时寻找要攻击的玩家。只能被末影龙使用。

minecraft:behavior.dragonflaming

允许龙使用龙息攻击。只能被末影龙使用。

minecraft:behavior.dragontakeoff

允许龙由栖息变为盘旋。只能被末影龙使用。

minecraft:behavior.dragonchargeplayer

允许末影龙以快速俯冲的方式攻击玩家。要攻击的玩家由dragonscanning标识选出。只能被末影龙使用。

minecraft:behavior.dragonstrafeplayer

允许末影龙寻找要发射火球的玩家。只能被末影龙使用。

minecraft:behavior.dragondeath

允许末影龙光荣牺牲。此标识控制末影龙的死亡动画并且不能被其他生物使用。

minecraft:behavior.enderman_leave_block

允许末影人放下它们随机拿起的方块。只能被末影人使用。

minecraft:behavior.enderman_take_block

允许末影人随机拿走一个方块。只能拿被末影人时使用。

minecraft:behavior.leap_at_target

允许怪物跳起来攻击它们的目标。只能被敌对生物时使用。

参数
类型 名称 默认值 描述
小数 yd 0.0 生物跳起来的高度(格)。
布尔值 must_be_on_ground true 若为true,生物只会在其目标在地面时跳起。设置为false会允许生物在目标在空中时跳起。

minecraft:behavior.guardian_attack

允许守卫者使用激光攻击。只能被守卫者和远古守卫者使用。

minecraft:behavior.slime_float

只能被史莱姆和岩浆怪时使用。控制它们是否能浮在水面/熔岩上。

minecraft:behavior.slime_keep_on_jumping

只能被史莱姆和岩浆怪使用。允许生物像史莱姆那样不停地跳。

minecraft:behavior.slime_random_direction

只能被史莱姆和岩浆怪使用。允许生物像史莱姆那样随机移动。

minecraft:behavior.slime_attack

只能被史莱姆和岩浆怪使用。允许生物使用类似于史莱姆那样的近战攻击。

minecraft:behavior.raid_garden

允许生物吃农场外的农作物,直至其吃饱。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 search_range 0 生物寻找要吃的作物的距离(格)。
小数 goal_radius 0.5 此生物认为其已完成目标的距离(格)。此属性是为了防止生物为了去到某个点而蹦蹦跳跳所作出的回旋空间。
整数 max_to_eat 6 实体想要吃下作物的最多数量。
整数 full_delay 100 生物想再次进食前的冷却时间(秒)。
整数 eat_delay 2 每次进食的间隔(秒)。
List blocks 生物要吃的方块。

minecraft:behavior.inspect_bookshelf

允许生物查阅书架。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 search_range 0 生物寻找要查阅的书架的距离(格)。
整数 search_height 1 生物寻找要查阅的书架的高度(格)。
整数 search_count 10 生物在其搜索范围内每刻检查有效的可移动的方块的数量。0表示每刻搜索1个方块。
小数 goal_radius 0.5 此生物认为其已完成目标的距离(格)。此属性是为了防止生物为了去到某个点而蹦蹦跳跳所作出的回旋空间。

minecraft:behavior.player_ride_tamed

允许生物在被玩家驯服后骑乘。

minecraft:behavior.find_mount

允许生物骑到另外一个生物身上。

参数
类型 名称 默认值 描述
小数 within_radius 0.0 生物搜索要骑乘的实体的距离(格)。
整数 start_delay 0 在移动到待骑乘的生物之前生物的等待时间。
布尔值 avoid_water false 若为true,生物在移动到待骑乘的生物时不会走进水里。
布尔值 target_needed false 若为true,生物只会在有目标时寻找骑乘生物。
小数 mount_distance -1.0 生物与待骑乘生物的距离(格)。如果此值低于0,生物会使用其默认攻击距离。

minecraft:behavior.controlled_by_player

允许生物能被玩家控制。

minecraft:behavior.wither_random_attack_pos_goal

允许凋灵发动随机攻击。只能被凋灵使用。

minecraft:behavior.wither_target_highest_damage

允许凋灵集中攻击对其造成最多伤害的生物。

参数
类型 名称 默认值 描述
JSON对象 entity_types 凋灵寻找对其造成最多伤害的实体类型列表。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目有效的条件。
小数 max_dist 16 此生物可执行此目标的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,此生物必须看见此实体才能执行此目标。
布尔值 must_see_forget_duration 3.0 生物决定在忘记当前目标前和目标不再可见时到寻找新目标之间所间隔的时间(秒)。

minecraft:behavior.float_wander

允许生物能像恶魂那样漂浮。

参数
类型 名称 默认值 描述
整数 xz_dist 10 生物寻找新的要移动的点的搜索距离(格)。必须至少为1。
整数 y_dist 7 生物寻找新的要移动的点的垂直搜索距离(格)。必须至少为1。
小数 y_offset 0.0 为到达选择的目标位置而添加的高度(格)。
布尔值 must_reach false 若为true,该点必须是可到达的才能成为一个有效的目标。
布尔值 random_reselect false 若为true,生物在移动到之前选择的位置时随机选取一个新目标点。
范围 [a, b] float_duration [0.0, 0.0] 生物在落地前或选择进行其他动作时的时间(秒)。

minecraft:behavior.trade_with_player

允许生物与玩家交易。

minecraft:behavior.summon_entity

允许生物生成其他实体攻击玩家。

参数
类型 名称 默认值 描述
List summon_choices 生物可生成实体的条目列表。每个条目的参数如下:
类型 名称 默认值 描述
小数 min_activation_range 1.0 此条目激活距离下限(格)。
小数 max_activation_range -1.0 此条目激活距离上限(格)。
小数 cooldown_time 0.0 此条目被再次使用前的冷却时间(秒)。
小数 weight 0.0 此条目的权重。控制生物生成此条目对应的实体的可能性。
布尔值 do_casting true 若为true,生物会显示生成动画,渲染出此条目的颗粒。
整数 particle_color 0 此条目的颗粒颜色。
Minecraft过滤器 filters
字符串 start_sound_event 使用此条目时要播放的音效。
List sequence 此条目的步骤。每个步骤的参数如下:
类型 名称 默认值 描述
字符串 shape line 此步骤的基础形状。有效值是circleline
小数 base_delay 0.0 此步骤开始前等待的秒数。
小数 delay_per_summon 0.0 此步骤每次生成的实体之间间隔的秒数。
整数 num_entities_spawned 1 在此步骤生成的实体数量。
字符串 entity_type 在此步骤生成的实体类型。
小数 entity_lifespan -1.0 生成的实体的生存时间。-1.0表示此实体在可以生存时一直生存。
小数 size 1.0 实体的基础尺寸。
字符串 target self 条目目标,即条目开始的位置(line会从该目标开始,circle会从该目标的中心开始)。
整数 summon_cap 0 在任何给定时间生成实体的最大数量。
小数 summon_cap_radius 0.0
字符串 sound_event 此步骤要播放的音效。
小数 cast_duration 所有步骤合计延迟时间。 执行条目所花费的时间(秒)。

minecraft:behavior.mingle

允许村民前往村庄中钟的位置,并与其他村民呆在一起。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
小数 cooldown_time 0.0 使用此目标前的冷却时间(秒)。
小数 duration 1.0 村民聊天的持续时间(秒)。

minecraft:behavior.send_event

允许生物向其他生物发送一个事件。

参数
类型 名称 默认值 描述
List sequence 要发送的事件。
每个事件的参数:
类型 名称 默认值 描述
小数 base_delay 0.0 开始此步骤前的延迟秒数。
字符串 event 发送至实体的事件。
字符串 sound_event 此步骤发生时播放的音效。
小数 cast_duration 所有步骤合计的延迟时间。 整个事件传送过程耗费的时间。

minecraft:behavior.charge_attack

允许生物跑向并攻击目标。

minecraft:behavior.vex_random_move

允许生物像恼鬼那样随机移动。

minecraft:behavior.vex_copy_owner_target

允许生物把其主人标记的实体设为目标。

参数
类型 名称 默认值 描述
JSON对象 entity_types 此实体可从实体复制的目标。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目有效的条件。
小数 max_dist 16 此生物可执行此目标的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,此生物必须看见此实体才能执行此目标。
布尔值 must_see_forget_duration 3.0 生物决定在忘记当前目标前和目标不再可见时到寻找新目标之间所间隔的时间(秒)。

minecraft:behavior.pickup_items

允许生物捡起地上的物品。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
布尔值 track_target false 若为true,此生物会在目标成为有效目标后追逐该目标。
小数 max_dist 0.0 生物搜索要捡起的物品的距离。
小数 goal_radius 0.5 此生物认为其已完成目标的距离(格)。此属性是为了防止生物为了去到某个点而蹦蹦跳跳所作出的回旋空间。

minecraft:behavior.share_items

允许生物向其他实体分享其物品。

参数
类型 名称 默认值 描述
JSON对象 entity_types 生物会分享的物品列表。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目有效的条件。
小数 max_dist 16 此生物可执行此目标的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,此生物必须看见此实体才能执行此目标。
布尔值 must_see_forget_duration 3.0 生物决定在忘记当前目标前和目标不再可见时到寻找新目标之间所间隔的时间(秒)。
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
小数 max_dist 0.0 生物搜索要分享物品的实体的最大距离(格)。
小数 goal_radius 0.5 此生物认为其已完成目标的距离(格)。此属性是为了防止生物为了去到某个点而蹦蹦跳跳所作出的回旋空间。

minecraft:behavior.find_underwater_treasure

允许生物移动至最近的水下废墟或沉船。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 search_range 0 生物在遗迹或沉船里搜索箱子宝藏的范围。
小数 stop_distance 2.0 生物停止移动之前的距离。

minecraft:behavior.circle_around_anchor

允许生物以圆形轨迹绕一个点或目标移动。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
范围 [a, b] radius_range [5.0, 15.0] 圆形轨迹半径(格)。
整数 radius_change_chance 250 一个决定何时把半径扩大至最大值的随机值。有每刻有1/此值的几率这样做。
范围 [a, b] height_above_target_range [0.0, 0.0] 当生物找到目标时,为启动引导点目标上方的高度距离。
范围 [a, b] height_offset_range [0.0, 0.0] 生物距离其引导点的高度便宜(格)。
整数 height_change_chance 350 一个决定何时修改生物高度的随机值。每刻有1/此值的几率这样做。
小数 goal_radius 0.5 此生物认为其已完成目标的距离(格)。此属性是为了防止生物为了去到某个点而蹦蹦跳跳所作出的回旋空间。

minecraft:behavior.swoop_attack

允许生物移动以对目标发动攻击。此标识在目标有水平碰撞或生物受伤时结束。此标识用于飞行生物。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
范围 [a, b] delay_range [10.0, 20.0] 再次使用此目标之前的冷却时间。

minecraft:behavior.pet_sleep_with_owner

允许宠物在其主人睡觉时上床。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 search_range 0 宠物可与主人一起睡觉与主人的距离(格)。
整数 search_height 1 宠物可与主人睡在一起与主人的垂直距离(格)。
小数 goal_radius 0.5 此生物认为其已完成目标的距离(格)。此属性是为了防止生物为了去到某个点而蹦蹦跳跳所作出的回旋空间。

minecraft:behavior.drop_item_for

允许生物靠近目标并丢弃物品。

参数
类型 名称 默认值 描述
小数 speed_multiplier 1.0 使用此AI标识时的移动速度乘数。
整数 search_range 0 生物与目标的距离(格)。
整数 search_height 1 生物与目标的垂直距离(格)。
小数 goal_radius 0.5 此生物认为其已完成目标的距离(格)。此属性是为了防止生物为了去到某个点而蹦蹦跳跳所作出的回旋空间。
JSON对象 entity_types 生物会丢弃物品的实体类型列表。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目有效的条件。
小数 max_dist 16 此生物可执行此目标的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,此生物必须看见此实体才能执行此目标。
布尔值 must_see_forget_duration 3.0 生物决定在忘记当前目标前和目标不再可见时到寻找新目标之间所间隔的时间(秒)。
小数 max_dist 0.0 此生物搜索要丢弃物品的实体的最大距离(格)。
小数 drop_item_chance [1.0] 生物丢弃物品的几率。
小数 offering_distance [1.0] 生物在丢弃物品时尝试与实体保持的距离(格)。
范围 [a, b] time_of_day_range [0.0, 1.0] 此标识的可用时间。例如:中午是0.0,日落是0.25,午夜是0.5,日出是0.75,再次回到中午是1.0。
字符串 loot_table 要选择物品的战利品表。
字符串 on_drop_attempt 生物尝试丢弃物品时要执行的事件。

minecraft:behavior.sneeze

允许生物停下并打喷嚏令其他生物受惊后丢弃一个物品。

参数
类型 名称 默认值 描述
小数 cooldown_time 0.0 能够再次使用此目标前的冷却时间(秒)。
小数 probability 0.02 打喷嚏的几率。1.00即100%。
小数 drop_item_chance 1.0 生物打喷嚏时丢下物品的几率。
字符串 loot_table 要选择掉落的物品的战利品表。
字符串 prepare_sound 即将要打喷嚏时要播放的音效。
字符串 sound 打喷嚏时播放的音效。
小数 prepare_time 1.0 准备打喷嚏的时间(秒),此时会播放prepare_sound指定的音效。
JSON对象 entity_types 会被打喷嚏吓到跳起来的实体。
参数
类型 名称 默认值 描述
Minecraft过滤器 filters 是使此列表里的条目有效的条件。
小数 max_dist 16 此生物可执行此目标的最大距离。
小数 walk_speed_multiplier 1.0 步行速度乘数。1.0代表速度不变。
小数 sprint_speed_multiplier 1.0 跑步速度乘数。1.0代表速度不变。
布尔值 must_see false 若为true,此生物必须看见此实体才能执行此目标。
布尔值 must_see_forget_duration 3.0 生物决定在忘记当前目标前和目标不再可见时到寻找新目标之间所间隔的时间(秒)。
小数 within_radius 0.0 实体能被吓到的距离(格)。

minecraft:behavior.roll

允许生物向前滚动。

参数
类型 名称 默认值 描述
小数 probability [1.0] 生物使用此标识的可能性。

过滤器

过滤器允许为数据对象指定特殊的测试条件以允许使用数据对象。例如,一个包含过滤器的模型只会在过滤器的条件为true时使用。

一般的过滤器有4个参数:

  • name:指定要应用的测试的名称。
  • domain:要运行测试的域,例如在盔甲槽中。该参数只被少数的测试使用。
  • operator:要对值进行比较的运算符,如equal或greater。
  • value:要比较的值。

一般的过滤器会是这样的:

{ "test" : "moon_intensity", "subject" : "self", "operator" : "greater", "value" : "0.5" }

这个过滤器会在被执行的实体(自身)在其位置计算moon_intensity,如果返回值大于0.5则返回true。

可使用all_of和any_of组合测试。all_of组中所有的测试必须按顺序通过,整个组的测试才会通过。而any_of组中的测试有一个或以上的测试通过,该组的测试便会通过。

is_daytime

如果时间为白天则返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于值的比较的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否大于或等于该值。
Boolean value true (可选)true或false。
示例:
完整版:
{ "test": "is_daytime", "subject": "self", "operator": "equals", "value": "true" }
精简版:(使用默认选项)
{ "test": "is_daytime" }

hourly_clock_time

把24小时制的当前时间与在range[0, 24000]中的一个整数值进行比较。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Integer value (必需)一个整数。
示例
完整版
{ "test": "hourly_clock_time", "subject": "self", "operator": "equals", "value": "0" }
精简版(使用默认值)
{ "test": "hourly_clock_time", "value": "0" }

is_game_rule

测试给定名称的游戏规则是否处于激活状态。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String domain (必需)要测试的游戏规则。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false。
示例
完整版
{ "test": "is_game_rule", "subject": "self", "domain": "domobspawning", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_game_rule", "domain": "domobspawning" }

is_underwater

实体在水下时返回true。实体完全沉到水里时,该实体会被认为在水下。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_underwater", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_underwater" }

clock_time

把当前时间与在(0.0, 1.0)范围里的一个浮点数进行比较。 0.0=正午 0.25=日落Sunset 0.5=午夜 0.75=日出

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Decimal value (必需)一个浮点数。
示例
完整版
{ "test": "clock_time", "subject": "self", "operator": "equals", "value": "0.00" }
精简版(使用默认值)
{ "test": "clock_time", "value": "0.00" }

moon_intensity

把当前月亮强度与在(0.0, 1.0)之间的一个浮点数进行比较。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Decimal value (必需) A floating point value.
示例
完整版
{ "test": "moon_intensity", "subject": "self", "operator": "equals", "value": "0.00" }
精简版(使用默认值)
{ "test": "moon_intensity", "value": "0.00" }

in_water

主体实体在水里时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "in_water", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "in_water" }

moon_phase

把当前月相和(0,7)之间的一个整数进行比较。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Integer value (必需)一个整数。
示例
完整版
{ "test": "moon_phase", "subject": "self", "operator": "equals", "value": "0" }
精简版(使用默认值)
{ "test": "moon_phase", "value": "0" }

distance_to_nearest_player

把附近最近的玩家的距离和一个浮点数进行比较。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Decimal value (必需)一个浮点数。
示例
完整版
{ "test": "distance_to_nearest_player", "subject": "self", "operator": "equals", "value": "0.00" }
精简版(使用默认值)
{ "test": "distance_to_nearest_player", "value": "0.00" }

has_equipment

在实体主体的指定槽里测试是否存在给定名称的物品。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String domain any (可选)要测试的位置。
选项 描述
any
feet
hand
armor
torso
head
leg
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (必需)要寻找的物品的名称。
示例
完整版
{ "test": "has_equipment", "subject": "self", "domain": "any", "operator": "equals", "value": "dirt" }
精简版(使用默认值)
{ "test": "has_equipment", "value": "dirt" }

is_underground

当主体实体在地下时返回true。如果实体上方有非固体方块,该实体会被认为在地下。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_underground", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_underground" }

in_water_or_rain

实体主体在水里或雨中时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "in_water_or_rain", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "in_water_or_rain" }

on_ground

实体主体在地上时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "on_ground", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "on_ground" }

is_brightness

测试当前亮度等级是否不等于在(0.0f,1.0f)之间的一个指定值。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Decimal value (必需)要与亮度等级比较的值。
示例
完整版
{ "test": "is_brightness", "subject": "self", "operator": "equals", "value": "0.50" }
精简版(使用默认值)
{ "test": "is_brightness", "value": "0.50" }

is_humid

测试主体是否在有湿度的区域内。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_humid", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_humid" }

in_lava

当实体主体在熔岩时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "in_lava", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "in_lava" }

is_mark_variant

如果主体实体有多个变种编号则返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Integer value (必需)一个整数。
示例
完整版
{ "test": "is_mark_variant", "subject": "self", "operator": "equals", "value": "0" }
精简版(使用默认值)
{ "test": "is_mark_variant", "value": "0" }

is_color

如果实体的主体的颜色与给定的颜色相同,则返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (必需)要测试的调色板颜色。
选项 描述
white
light_green
orange
silver
magenta
light_blue
yellow
pink
blue
gray
cyan
purple
brown
green
red
black
示例
完整版
{ "test": "is_color", "subject": "self", "operator": "equals", "value": "white" }
精简版(使用默认值)
{ "test": "is_color", "value": "white" }

in_clouds

实体主体在云中时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "in_clouds", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "in_clouds" }

on_ladder

实体主体在梯子上时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "on_ladder", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "on_ladder" }

has_component

实体主体含有已命名的组件时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (必需)要搜索的组件名称。
示例
完整版
{ "test": "has_component", "subject": "self", "operator": "equals", "value": "minecraft:explode" }
精简版(使用默认值)
{ "test": "has_component", "value": "minecraft:explode" }

is_family

实体主体是一个已命名的family时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (必需)要搜索的family名称。
示例
完整版
{ "test": "is_family", "subject": "self", "operator": "equals", "value": "player" }
精简版(使用默认值)
{ "test": "is_family", "value": "player" }

is_sneaking

实体主体在潜行时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_sneaking", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_sneaking" }

has_ability

当实体主体有指定名称的能力时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (必需)要测试的能力类型。
选项 描述
worldbuilder
invulnerable
flying
instabuild
flySpeed
lightning
walkSpeed
noclip
mayfly
mute
示例
完整版
{ "test": "has_ability", "subject": "self", "operator": "equals", "value": "instabuild" }
精简版(使用默认值)
{ "test": "has_ability", "value": "instabuild" }

has_damage

当实体主体受到指定类型的伤害时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (必需)要测试的伤害类型。
选项 描述
contact
none
lava
attack
override
projectile
suffocation
fall
starve
fire
fatal 任何会杀死该主体的伤害。
fire_tick
drowning
block_explosion
entity_explosion
void
suicide
magic
wither
anvil
thorns
falling_block
piston
fly_into_wall
示例
完整版
{ "test": "has_damage", "subject": "self", "operator": "equals", "value": "fatal" }
精简版(使用默认值)
{ "test": "has_damage", "value": "fatal" }

is_owner

当实体主体是被执行实体的主人时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_owner", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_owner" }

is_target

当实体主体是被执行实体的目标时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_target", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_target" }

is_immobile

实体主体静止时返回true。若实体没有AI标识、刚进入了不同的维度或没有生命值,该实体为静止的。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_immobile", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_immobile" }

is_altitude

测试当前高度是否不等于指定值。0为基岩层的高度。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Integer value (必需)要与高度进行比较的值。
示例
完整版
{ "test": "is_altitude", "subject": "self", "operator": "equals", "value": "0" }
精简版(使用默认值)
{ "test": "is_altitude", "value": "0" }

is_moving

实体主体在移动时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_moving", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_moving" }

is_climbing

实体主体在攀爬时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_climbing", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_climbing" }

is_riding

如果实体主体正在骑乘其他实体则返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_riding", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_riding" }

in_caravan

实体主体在商队里时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "in_caravan", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "in_caravan" }

is_leashed

实体主体被拴住时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_leashed", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_leashed" }

is_variant

实体主体有多个编号时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Integer value (必需)一个整数。
示例
完整版
{ "test": "is_variant", "subject": "self", "operator": "equals", "value": "0" }
精简版(使用默认值)
{ "test": "is_variant", "value": "0" }

has_tag

实体主体有指定的标签时返回true。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (可选) A string value.
示例
完整版
{ "test": "has_tag", "subject": "self", "operator": "equals", "value": "" }
精简版(使用默认值)
{ "test": "has_tag" }

is_difficulty

测试游戏当前难度等级。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (必需)要测试的难度等级。
选项 描述
peaceful
easy
normal
hard
示例
完整版
{ "test": "is_difficulty", "subject": "self", "operator": "equals", "value": "normal" }
精简版(使用默认值)
{ "test": "is_difficulty", "value": "normal" }

is_biome

测试主体是否在给定名称的生物群系里。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (必需)要测试的生物群系类型。
选项 描述
ice
forest
extreme_hills
beach
jungle
desert
flat
the_nether
mesa
plain
mushroom_island
ocean
river
savanna
stone_beach
swamp
taiga
the_end
示例
完整版
{ "test": "is_biome", "subject": "self", "operator": "equals", "value": "beach" }
精简版(使用默认值)
{ "test": "is_biome", "value": "beach" }

has_biome_tag

测试主体所处的生物群系里是否有指定的标签。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (必需)要查找的标签。
示例
完整版
{ "test": "has_biome_tag", "subject": "self", "operator": "equals", "value": " " }
精简版(使用默认值)
{ "test": "has_biome_tag", "value": " " }

is_snow_covered

测试主体是否在有雪覆盖的区域内。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Boolean value true (可选)true或false.
示例
完整版
{ "test": "is_snow_covered", "subject": "self", "operator": "equals", "value": "true" }
精简版(使用默认值)
{ "test": "is_snow_covered" }

is_temperature_type

测试当前温度是否为指定类型。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
String value (必需)要测试的生物群系温度分类。
选项 描述
ocean
cold
mild
warm
示例
完整版
{ "test": "is_temperature_type", "subject": "self", "operator": "equals", "value": "cold" }
精简版(使用默认值)
{ "test": "is_temperature_type", "value": "cold" }

is_temperature_value

测试当前温度是否不等于在(0.0, 1.0)之间的一个指定值。0.0f是最冷的温度,1.0f是最热的温度。

参数
类型 名称 默认值 描述
String subject self (可选)过滤器测试的主体。
选项 描述
self 执行测试的实体或对象。
other 交互中的其他对象(不是执行者)。
parent 执行者的当前的父对象。
player 参与交互的玩家。
target 执行者的当前目标。
String operator equals (可选)用于比较值的运算符。
选项 描述
>= 测试是否大于或等于该值。
equals 测试是否等于该值。
<> 测试是否不等于该值。
== 测试是否等于该值。
= 测试是否等于该值。
not 测试是否不等于该值。
< 测试是否小于该值。
!= 测试是否不等于该值。
> 测试是否大于该值。
<= 测试是否小于或等于该值。
Decimal value (必需)要比较的生物群系温度值。
示例
完整版
{ "test": "is_temperature_value", "subject": "self", "operator": "equals", "value": "0.50" }
精简版(使用默认值)
{ "test": "is_temperature_value", "value": "0.50" }
此过滤器组只会在moon_inensity>0.5并且被执行的目标实体在水里时才通过。
"all_of" : [

:   { "test" : "moon_intensity", "subject" : "self", "operator" : "greater", "value" : "0.5" }, 

:   { "test" : "in_water", "subject" : "target", "operator" : "equal", "value" : "true" } 

: ]

实体

方块

Geometry

方块

参数
类型 名称 默认值 描述
String format_version 0.0.0.0 要使用的方块Geometry版本。该属性用于向后兼容。
String parent 此模型的父模型。
List materials #0 此模型使用的材料。
List elements 组成此方块Geometry的元素列表,元素参数如下:
类型 名称 默认值 描述
String name 元素名称。
String parent 元素的父元素的名称。Pivot和box位置是相对于父元素的pivot而言。
Vector [a, b, c] rotation [ 0.0, 0.0, 0.0 ] 其pivot的旋转角度。
Vector [a, b, c] pivot [ 0.0, 0.0, 0.0 ] 元素在pivot点的模型空间里的位置。此属性用作元素的“center”位置以及旋转的中心点。
String material 此元素的材料(若与方块不同)。
List boxes 此元素组成Geometry的cube列表。
参数
类型 名称 默认值 描述
Vector [a, b, c] origin [ 0.0, 0.0, 0.0 ] 相对于Geometry的中心点位置。
Vector [a, b, c] size [ 0, 0, 0 ] 在x、y和z坐标上的缩放大小。默认为1,1,1。
String material 此box的材料(若与元素不同)。
List faces 模型的6个面的列表。如果此属性被指定,则必须指定其6个面(前、后、左、右、上、下)。
Parameters
类型 名称 默认值 描述
String material 该面的材料(若与box不同)。
Vector [a, b, c, d] uv [ 0.0, 0.0, 1.0, 1.0 ] 这一面的材质坐标,值的格式为0.0-1.0之间的最小x、最小y、最大x、最大y。
Decimal rotation 0.0 该面的UV旋转。此属性只接受的值为:0、90和270°。此属性允许以旋转材质的方式以将其重新使用至不同的面上。

数据驱动生成

数据驱动生成允许开发者调整生物(包括新加入的在生物群系中自然生成的生物)的生成条件,添加或移除生物在创造模式物品栏中对应的刷怪蛋以及设置生物的刷怪蛋和加入/remove/summon命令对此生物的支持。

生成规则

入门

新的生成规则包含在行为包里。把规则放进行为包根目录的spawn_rules新文件夹内即可开始。在此文件夹内,新建并命名一个JSON文件。JSON文件需要有格式、描述和条件。生成规则包含描述和条件。所有的JSON文件都需要有一个ID(在描述部分下)。与其他标识符类似,JSON文件也遵循“命名空间:名称”的约定。minecraft命名空间存放了原版Minecraft生成规则。在修改一个存在的生物的规则时,此实体的实体ID需要出现在JSON文件里。而新建生物时,确保在此实体的JSON文件中所有的ID都是相同的。

生成规则也需要定义一个用于控制数量的池。每个池有其生成限制,通过把实体设置到一个池内,该实体将会在这个池没达到生成限制时生成。

实体可以分配到3个池:-animal-water_animal-monster

条件

组件包含了不同的组件,这些组件可用来自定义生物群系的自然生成。

组件
名称 描述
minecraft:spawns_on_surface 这个组件允许生物在地面上生成。添加组件会使其为true,删除组件会使生物停止在表面上生成。
minecraft:spawns_underwater 这个组件允许生物在地面上生成。添加组件会使其为true,删除组件会使生物停止在水下生成。
minecraft:brightness_filter 此组件允许玩家设置使生物生成的光照等级范围。
参数
类型 名称 默认值 描述
整数 min 0.0 这是允许该生物生成的最低亮度
整数 max 15.0 这是允许该生物生成的最高亮度
Boolean adjust_for_weather false 当光照强度改变时,生物将会生成(例如:当雨天时允许敌对生物在白天生成)
minecraft:weight 该组件允许玩家优先定义该生物应该多久繁殖一次。权重值较低的生物比权重值较高的生物更有可能繁殖。
参数
整数 default 0.0 该生物生成的优先度
minecraft:difficulty_filter 这个组件允许玩家确定当设置了一定的难度等级时,生成什么生物。
参数
类型 名称 默认值 描述
字符串 min 允许该生物生成的最小难度等级
字符串 max 允许该生物生成的最大难度等级
minecraft:herd 这个组件允许玩家确定动物的群体大小。
参数
类型 名称 默认值 描述
整数 min_size 该生物成群生成的最小数目
整数 max_size 该生物成群生成的最大数目
字符串 event 生物生成时激活的事件
整数 event_skip_count 这是在触发指定事件之前生成的生物数量。
minecraft:biome_filter 这个组件允许玩家指定生物的生物群系。查看下面的生物群系标签,看看每个生物群系的标签是什么。

生物群系标签

游戏中的每个生物群落都有一个或多个标签。这些是用来确定生物群系生成什么生物。这些是可以使用的生物标签列表:

标签
monster
animal
ocean
nether
the_end
mooshroom_island
plains
desert
jungle
taiga
extreme_hills
savanna
frozen
cold
lukewarm
warm
river
swamp
beach
flower_forest
forest
birch
dark_oak
hills
mutated
edge
lakes
plateau
deep
mesa
ice_plains
ice
mountain
shore
stone
roofed
mega

各生物群系所附带的标签

生物群系 标签
平原 animal, monster, plains
沙漠 monster, desert
山地 animal, monster, extreme_hills
森林 animal, monster, forest
针叶林 animal, monster, taiga
沼泽 animal, monster, swamp
河流 river
下界 nether
末地 the_end
冻洋 ocean, frozen
冻河 river, frozen
积雪的冻原 frozen, ice_plain, ice
雪山 frozen, ice, mountain
蘑菇岛 mooshroom_island
蘑菇岛岸 mooshroom_island, shore
沙滩 monster, beach, warm
沙漠丘陵 monster, desert, hills
森林丘陵 animal, monster, hills
针叶林丘陵 animal, monster, taiga, hills
山地边缘 animal, monster, extreme_hills, edge, mountain
丛林 animal, monster, jungle
丛林丘陵 animal, monster, jungle, hills
丛林边缘 animal, monster, jungle, edge
积雪的沙滩 monster, beach, cold
石岸 monster, beach, stone
桦木森林 animal, monster, birch, forest
桦木森林丘陵 animal, monster, birch, forest, hills
黑森林 animal, monster, forest, roofed
积雪的针叶林 animal, monster, taiga, cold
积雪的针叶林丘陵 animal, monster, taiga, cold, hills
巨型针叶林 animal, monster, taiga, mega
巨型针叶林丘陵 animal, monster, taiga, mega, hills
繁茂的山地 animal, monster, extreme_hills, forest, mountain
热带草原 animal, monster, savanna
热带高原 animal, monster, savanna
恶地 monster
被风蚀的恶地 monster, plateau
恶地高原 monster, mesa
海洋 ocean, monster
深海 ocean, monster, deep
暖水海洋 ocean, warm, monster
暖水深海 ocean, warm, monster, deep
温水海洋 ocean, lukewarm, monster
温水深海 ocean, lukewarm, monster, deep
冷水海洋 ocean, cold, monster
冷水深海 ocean, cold, monster, deep
冻洋 ocean, frozen, monster
封冻深海 ocean, frozen, monster, deep
平原变种 animal, monster, plains, mutated
沼泽变种 animal, monster, swamp, mutated
积雪的冻原变种 monster, frozen, ice_plains, mutated
积雪的针叶林变种 animal, monster, taiga, cold, mutated
热带草原变种 animal, monster, savanna, mutated
热带高原变种 animal, monster, savanna, plateau, mutated
黑森林变种 animal, monster, roofed, forest, mutated
沙漠变种 monster, desert, mutated
森林变种 monster, flower_forest, forest, mutated
针叶林变种 animal, monster, taiga, mutated
丛林变种 animal, monster, jungle, mutated
丛林边缘变种 animal, monster, jungle, edge, mutated
恶地变种 animal, monster, mesa, mutated
恶地高原变种 monster, mesa, plateau, mutated
风蚀的恶地变种 monster, mesa, plateau, mutated, stone
桦木森林变种 animal, monster, forest, birch, mutated
桦木森林丘陵变种 animal, monster, forest, birch, mutated, hills
巨型针叶林变种 animal, monster, mutated, mega
山地变种 animal, monster, extreme_hills, mutated
山地+变种 animal, monster, extreme_hills, mutated, forest
巨型针叶林丘陵变种 animal, monster, taiga, mega, hills, mutated

示例:僵尸的生成规则

"format_version": "1.8.0",
  "minecraft:spawn_rules": {
    "description": {
      "identifier": "minecraft:zombie",
      "population_control": "monster"
    },
    "conditions": [
      {
        "minecraft:spawns_on_surface": {},
        "minecraft:brightness_filter": {
          "min": 0,
          "max": 7,
          "adjust_for_weather": true
        },
        "minecraft:difficulty_filter": {
          "min": "easy",
          "max": "hard"
        },
        "minecraft:weight": {
          "default": 100
        },
        "minecraft:herd": {
          "min_size": 2,
          "max_size": 4
        },
        "minecraft:permute_type": [
          {
            "weight": 95
          },
          {
            "weight": 5,
            "entity_type": "minecraft:zombie_villager"
          }
        ],
        "minecraft:biome_filter": {
          "test": "has_biome_tag", "operator": "==", "value": "monster"
        }
      }
    ]
  }

客户端实体文档

Template:Translation:未知参数。

翻译者从英文条目翻译下文中的内容时感觉其艰涩难懂。

翻译者希望更有能力的用户能够帮助改善本条目的行文,所以请先慎重对待本条目内容。
如果可能,请帮助我们完善此条目的内容。

此文档包含如何在Minecraft中创建新的客户端实体定义(New client entity definitions)的流程。

概要

架构应遵循当前的Minecraft JSON范例:

  • 字段应为小写并使用下划线(无空格)
  • 字段值应有所指向(浮点数应该只是浮点数,而不是字符串)
  • “实体”中的所有JSON文件。目录是实体在世界中加载所必需的

对于十月技术预览,您需要启用“使用实验游戏”。世界上的选项在资源包中使用此功能。

开始

新的用户实体定义被资源包所包含。

实体

首先,创建一个新文件夹并将其命名为“entity”。在资源包的根目录内,在实体文件夹中创建一个JSON文件并为其命名。JSON文件需要格式版本和minecraft:client_entity信息。

重要对于10月技术预览版,格式版本需要为1.8.0.-beta.1。 这允许在试用游戏时使用客户端实体定义JSON。

下面是猪的客户端实体定义JSON。

{   
  "format_version": "1.8.0-beta.1",   
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:pig",
      "materials": { 
        "default": "pig"
      },
      "textures": {
        "default": "textures/entity/pig/pig",
        "saddled": "textures/entity/pig/pig_saddle"
      },
      "geometry": {
        "default": "geometry.pig"
      },
      "animations": {
        "setup": "animation.pig.setup",
        "walk": "animation.quadruped.walk",
        "look_at_target": "animation.common.look_at_target",
        "baby_transform": "animation.pig.baby_transform"
      },
      "animation_controllers": [
        {
          "setup": "controller.animation.pig.setup" 
        },
        {
          "move": "controller.animation.pig.move"
        },
        {
          "baby": "controller.animation.pig.baby"
        }
      ],
      "render_controllers": [ "controller.render.pig" ],
      "locators": {
        "lead": { 
          "head": [ 0.0, 14.0, -6.0 ]
        }
      },
      "spawn_egg": {
        "texture": "spawn_egg",
        "texture_index": 2
      }
    }
  }
}

minecraft:client_entity包含实体的描述。在描述中,您可以设置有关实体的许多内容。通常,此文件定义了生物需要的资源,并为每个资源提供友好名称,使其他定义文件可以使用。

标识

标识用于向服务器注册实体。在客户端实体定义JSON中,标识设置实体的外观(材料,材质,几何等)。JSON中的Behavior Pack中的标识赋予实体行为。

min_engine_version

如果存在,玩家可以设置允许解析JSON所需的最小版本。将定义中的版本与构建顶级资源包的引擎版本进行比较。如果定义的min_engine_version比该包的引擎版本新,则不解析该定义。

多个定义文件可以使用相同的标识符,在这种情况下,只会加载其中一个定义。与顶级资源包的引擎版本相比,解析具有相同或接近且不大于min_engine_version的定义; 将不会解析具有相同标识符的所有其他定义。

当用旧资源包覆盖新资源包时,这对于继续支持较旧版本的实体非常有用,同时在所有其他情况下也支持较新版本的实体。

材料、材质、几何

玩家可以在这一部分选择实体的材料、材质、几何。玩家可以设置一个或多个生物的材料、材质、几何。玩家必须设置它们的名字。这些名字会被Render Controllers JSON使用。玩家可以从原版材质中并且自定义材质。这些材质应该被放在Resource Pack文件夹中正确的位置。

脚本

脚本使玩家可以使用Mojang的模板来计算并储存数据。这个数据可以被重复使用,并不用反复地人工计算。目前脚本支持预动画(pre-animation)和尺寸(scale)。更多脚本种类会在之后被加入。

  • 预动画会在动画处理前立刻评估脚本
  • 尺寸设置生物的几何

鳕鱼的预动画脚本

       
"scripts": {
  "pre_animation": [
    "Entity.ZRot == !Entity.IsInWater ? Math.cos((Entity.Member.TimeStamp + Params.FrameAlpha) * 14.32) * 90 : 0.0;",
    "Entity.AnimationAmountBlend == Math.lerp(Entity.AnimationAmountPrev, Entity.AnimationAmount, Params.FrameAlpha);"
  ]
},

蝙蝠尺寸代码示例

"scripts": {
  "scale": "0.35"
},

动画

玩家可以改动画名字。这些动画名字会被JSON的动画控制器使用。玩家可以通过更改Minecraft原版材质来创造自己的动画。自定义动画应该被储存在Resource Pack文件夹中的相对应位置。

动画控制器

动画控制器决定了动画应该在什么时候处理。每个控制器罗列一个或多个动画状态。玩家可以更改动画处理器的名字。名字应该与其他生物动画控制器的名字有所不同。玩家可更改Minecraft原版材质来创造自己的动画控制器。自定义动画控制器应该被储存在Resource Pack文件夹中的相对应位置。

颗粒

允许玩家指定一个键来引用颗粒的长名称。 如果存在这些,则在生成实体时创建粒子。自定义的键应该与其他生物动画控制器的名字有所不同。玩家可更改Minecraft原版材质来创造自己的颗粒。自定义颗粒应该被储存在Resource Pack文件夹中的相对应位置。

渲染控制器

指定渲染控制器的名称。此名称需要与Render Controllers文件夹中对应的JSON的名称匹配。玩家可更改Minecraft原版材质来创造自己的渲染控制器。自定义渲染控制器应位于资源包根目录的textures文件夹中。

定位器

定位器偏移在模块空间中指定。定位器的例子有 "lead&quot;定位器用于显示指引将附加到何处。

例子

"locators": {
  "lead": {
    "head": [ 0.0, 14.0, -6.0 ] 
  }
}

enable_attachables

这决定当实体设置为true时,实体是否可以装备。这允许实体渲染装甲。

例: "enable_attachables": true

刷怪蛋

这设置刷怪蛋的颜色。有两种方法:第一种是使用十六进制值来决定底部颜色和上部颜色。

用十六进制值来决定刷怪蛋颜色的例子:

"spawn_egg": {
  "base_color": "#53443E",
  "overlay_color": "#2E6854"
}

另外一种方法是指定一个材质:

一个指定材质的刷怪蛋的例子。刷怪蛋储存在材质包文件夹里的JSON,"items_texture&quot;当这个材质有多个名称时,你可以用指数选其中一个。如果没有特别指定的指数,你可以假设第一个材质的指数为0.

"spawn_egg": {
  "texture": "spawn_egg",
  "texture_index": 2
}

服务器端实体文档

实体定义属性

这些属性是实体定义中的一部分,在组件(Component)和组件组(Component Group)的之前。确保在组件、组件组或者事件(Event)之前插入实体定义属性,否则实体属性就会被无视。

do_not_upgrade

关闭所有目前和之后的实体兼容性。如果加入新的组件和属性或者更改原版的实体,这些更新不会有效。


format_version

指定该该实体制作时的版本。如果该版本比目前版本要低,任何对原版实体的更改均有效。


代码案例
案例
{
  "minecraft:entity": {
    "format_version": "1.2.0",
    "do_not_upgrade": {},
    "component_groups": {
      ...
    }
    ...
  }
}


实体描述属性

此部分定义需要指定和建造实体的属性

animations

设置参考真实动画的内在动画。这是个名称/动画组的JSON对象。

参数
Type Name Default Value Description
String name none Internal (to the entity) name of this animation entry
String animation none Actual animation to use


scripts

设置参考动画控制器的内在动画的结构。这是个名称/动画控制器组的JSON数组。

参数
Type Name Default Value Description
String name none Internal (to the entity) name of this animation entry
String animation controller none Actual animation to use


Entity Description Properties

identifier

设置此实体的描述的名称。

参数
Type Default Value Description
String The identifier for this entity


runtime_identifier 

设置原版Minecraft对该实体构建的识别码的名称。

参数
Type Default Value Description
String The identifier for the class to construct this entity with


is_spawnable 

设置该实体可不可以使用创造模式界面的刷怪蛋生成。

参数
Type Default Value Description
Boolean false Set to determine if this entity has a spawn egg.


is_summonable 

设置该实体可不可以使用诸如/summon的命令来生成。

参数
Type Default Value Description
Boolean false Flag to mark this entity as being summonable or not.


is_experimental 

设置该实体是否是实验性的。实验性实体只能通过实验性玩法获得。

参数
Type Default Value Description
Boolean false Flag to mark this entity as being experimental or not.




属性

minecraft:attack

定义实体的近距离攻击和其带有的效果。

参数
种类 名称 默认值 描述
范围[a, b] damage 近距离伤害的随机值。负值可恢复被攻击对象的生命值。
字符串 effect_name 该实体近距离攻击附加的状态效果的识别码
小数 effect_duration 0.0 该状态效果的持续时间


minecraft:spell_effects

定义在加入组件后,对该实体加入或移除什么生物效果。

参数
种类 名称 默认值 描述
列表 add_effects 在加入这个组件后,罗列该实体所加入的效果的识别码
参数
种类 名称 默认值 描述
字符串 effect 加入该实体的效果。包括“持续时间”(秒)、“放大器”等级、“环境”(如果是一个环境效果)、和“可见性”(如果该效果可见)
字符串 remove_effects 再加入该组件后,罗列出要从该实体移除的效果的识别码


minecraft:strength

定义该实体携带物品的能力(力量)。

参数
种类 名称 默认值 描述
整数 value 1 力量的初始值
整数 max 5 该实体的最大力量

属性

minecraft:ambient_sound_interval

设置实体播放两次环境音效之间的间隔时间。

参数
种类 名称 默认值 描述
小数 value 8.0 该实体随机播放两次环境音效之间的最小间隔时间
小数 range 16.0 该实体随机播放两次环境音效之间的最大间隔时间


minecraft:burns_in_daylight

指定该实体是否/如何在阳光下燃烧。


minecraft:can_climb

允许实体把梯子。


minecraft:can_fly

标记该实体可以飞行,寻路机制不会受该实体下方的固体方块影响。


minecraft:can_power_jump

允许实体像原版的马一样蓄力跳跃。


minecraft:collision_box

设置该实体的碰撞箱的宽和高。

参数
种类 名称 默认值 描述
小数 width 1.0 碰撞箱的长和宽(方块),负值默认为0
小数 height 1.0 碰撞箱的高度(方块),负值默认为0


minecraft:color

定义该实体的颜色。仅适用于原版中带有颜色值的生物(如羊、羊驼、潜影贝)。

参数
种类 名称 默认值 描述
整数 value 0 该实体的调色板颜色值


minecraft:color2

定义该实体的第二材质颜色。仅适用于原版中有第二颜色值的生物(热带鱼)。

参数
种类 名称 默认值 描述
整数 value 0 该实体的第二调色板颜色值


minecraft:default_look_angle

设置该实体的默认头旋转角度。

参数
种类 名称 默认值 描述
小数 value 0.0 旋转角度


minecraft:is_dyeable

允许使用染料来改变该实体的颜色。

参数
种类 名称 默认值 描述
字符串 interact_text 在使用触屏设备给对实体使用染料所显示的文本


minecraft:equipment

设置该实体的装备列表。

参数
种类 名称 默认值 描述
字符串 table 装备列表的文件路径,和behavior pack的根文件有关
列表 slot_drop_chance 罗列装备栏中的有概率掉落的装备


minecraft:fire_immune

设置该实体不会受到火焰伤害。


minecraft:type_family

定义该实体所属的科系(Family)。

参数
种类 名称 默认值 描述
List family 科系名称


minecraft:floats_in_liquid

设置该实体能浮在液体方块上方。

minecraft:flying_speed

实体飞行的速度(方块)。

参数
种类 名称 默认值 描述
小数 value 0.02 实体移动速度(方块/刻)


minecraft:foot_size

设置实体在不跳跃的情况下每步的长度。

参数
种类 名称 默认值 描述
小数 value 0.5 实体每步的长度


minecraft:friction_modifier

定义该实体受多少摩擦力的影响。

参数
种类 名称 默认值 描述
小数 value 1.0 数值越高,该生物受摩擦力的影响越大。1.0代表正常摩擦力,2.0代表两倍摩擦力


minecraft:hurt_when_wet

指定该实体是否受到水的伤害。

minecraft:ground_offset

设置实体实际所在的地面偏移量。

参数
种类 名称 默认值 描述
小数 value 0.0 设置实体实际所在的地面偏移量(方块)。


minecraft:is_baby

设置该实体为幼年。

minecraft:is_charged

设置该实体为充能。


minecraft:is_chested

设置该实体目前搭载一个箱子。


minecraft:is_ignited

设置该实体目前在着火。


minecraft:is_saddled

设置该实体目前带有鞍。


minecraft:is_shaking

设置该实体目前在抖动。


minecraft:is_sheared

设置该实体被剪刀剪过


minecraft:is_stackable

设置该实体能被堆叠。


minecraft:is_tamed

设置该实体为已驯服。


minecraft:item_controllable

定义当在该实体被骑乘时,什么物品可以用来控制。

参数
种类 名称 默认值 描述
列表 control_items 罗列出能控制该实体的物品。


minecraft:loot

设置在该生物死亡时能掉落的物品列表。

参数
种类 名称 默认值 描述
字符串 table 战利品表的路径,和Behavior Pack根文件有关


minecraft:push_through

设置该实体能被推动的距离。

Parameters
种类 名称 默认值 描述
小数 value 0.0 该实体能被推动的距离(方块)


minecraft:scale

设置该实体的视觉大小。

参数
种类 名称 默认值 描述
小数 value 1.0 数值,1.0为该实体视觉大小为模型定义的大小。数值越大,视觉尺寸越大


minecraft:sound_volume

设置该实体的音效的原音量。

参数
种类 名称 默认值 描述
小数 value 1.0 该实体音效的原本音量


minecraft:variant

用来区分实体变种的组件组(如猫、村民)

参数
种类 名称 默认值 描述
整数 value 0 变种的ID值。通常,0为原版生物


minecraft:mark_variant

更多变种值,可用来进一步区分实体变种。

参数
种类 名称 默认值 描述
整数 value 0 变种的ID值。通常,0为原版生物


minecraft:walk_animation_speed

设置该实体走路动画速度的乘数。

参数
种类 名称 默认值 描述
小数 value 1.0 数值越高,走路动画月卡。1.0代表正常速度,2.0代表两倍速度


minecraft:wants_jockey

设置该实体想要变成一个骑手。


minecraft:input_ground_controlled

当实体作为可骑乘时,该实体能使用WASD键控制。

组件

minecraft:addrider

在实体上加入骑手。需要minecraft:rideable.

参数
种类 名称 默认值 描述
字符串 entity_type 骑乘在该实体上的实体种类


minecraft:ageable

加入实体长大的时间,可以通过物品来加快成长速度;该物体被feedItems所定义

参数
种类 名称 默认值 描述
小数 duration 1200.0 需要成长的时间,-1总是为幼年
列表 feedItems 罗列出能用来喂该实体的物品。包括物体“item”和“growth”来定义该实体需要多长时间来成长
列表 drop_items 罗列出长大时掉落的物品。
字符串 grow_up 该实体长大时的事件


minecraft:angry

定义该实体的“发怒”状态和时间

参数
种类 名称 默认值 描述
整数 duration 25 发怒的持续时间(秒)
整数 duration_delta 0 时间误差范围[-δ,δ]
布尔值 broadcastAnger false 如果为true,在这个broadcastRange中的其他相同定义的实体也会发怒
整数 broadcastRange 20 在这个距离(方块)范围内的其他相同定义实体也会发怒
Minecraft Filter broadcast_filters 能让列表中该条目生效的条件
字符串 calm_event 在持续时间中指定的秒数到期后运行的事件(当实体停止“发怒”时)


minecraft:boostable

定义条件和一个可骑乘实体的加成的行为

参数
种类 名称 默认值 描述
整数 duration 3 加成的持续时间
小数 speed_multiplier 1.0 速度加成的乘数,2.0代表两倍速度
列表 boost_items 罗列出在骑乘该实体时,该实体所获得的状态效果。每个物品有以下属性:
参数
种类 名称 默认值 描述
字符串 item 能用来加成的物品名称
字符串 replaceItem 用来加成的物品在使用后变成这个物品
整数 damage 1 在每次使用该物品时该物品受到的伤害。


minecraft:annotation.break_door

允许实体破坏门,前提是要在该实体的寻路机制中设置目标。


minecraft:breathable

定义什么方块该实体可以呼吸,并且使该实体有窒息的能力

参数
种类 名称 默认值 描述
整数 totalSupply 15 该实体能屏住呼吸的时间
整数 suffocateTime -20 窒息伤害间隔时间
小数 inhaleTime 0.0 该实体能恢复满呼吸栏的时间
布尔值 breathesAir true 如果为true,该实体能呼吸空气
布尔值 breathesWater false 如果为true,该实体能在水中呼吸
布尔值 breathesLava false 如果为true,该实体能在岩浆中呼吸
布尔值 breathesSolids false 如果为true,该实体能在固体方块中呼吸
布尔值 generatesBubbles true 如果为truw,该实体在水中会发出可见的泡泡颗粒
列表 breatheBlocks 罗列出该实体能呼吸的方块,加上上述的呼吸条件
列表 nonBreatheBlocks 罗列出该实体不能呼吸的方块,加上上述呼吸条件


minecraft:burns_in_daylight

指定该生物是否/如何在阳光下燃烧。


minecraft:strength

定义该实体携带物品的能力。

参数
种类 名称 默认值 描述
整数 value 1 力量的初始值
整数 max 5 力量的最大值


minecraft:breedable

定义该实体进入繁殖模式的方式。

参数
种类 名称 默认值 描述
布尔值 requireTame true 如果为true,该实体在繁殖前需要被驯服。
布尔值 blend_attributes true 如果为true,该实体的后代会混合其属性。例如马的生命值、移动速度、和跳跃能力
小数 extraBabyChance 0.0 能一次性生成16个幼崽的几率,从0.0到1.0,1.0为100%几率
小数 breedCooldown 60.0 两次繁殖之间的冷却时间
布尔值 inheritTamed true 如果为true,在父母被驯服的情况下,幼崽会为已驯服状态
布尔值 allowSitting false 如果为true,实体能在坐下时繁殖
JSON对象 mutation_factor 确定幼崽有多可能不继承其父母的属性。值介于0.0和1.0之间,数字越大意味着更有可能发生突变
参数
种类 名称 默认值 描述
小数 variant 0.0 实体变种突变几率的百分比
小数 extra_variant 0.0 实体额外变种突变几率的百分比
小数 color 0.0 实体变种颜色突变几率的百分比

|- | 列表 | breedItems | | 能用来使实体进入繁殖模式的物品列表 |- | 列表 | environment_requirements | | 能用来使实体进入繁殖模式的方块列表

block 

使生物繁殖的附近的方块。


count 

附近所需块类型的数量,以供实体繁殖。


radius 

实体在这个范围内寻找该方块,范围为0-16


|- | 列表 | breedsWith | | 罗列出该实体用来繁殖的实体定义。

参数
种类 名称 默认值 描述
字符串 mateType 交配种类的实体定义
String babyType 实体后代的实体定义
字符串 breed_event 实体繁殖时的事件

|- | 布尔值 | causes_pregnancy | false | 如果为true,该实体会“怀孕”,而不会生成一个幼崽。 |}


minecraft:bribeable

定义实体可以进入“被勾引”模式。

参数
种类 名称 默认值 描述
小数 bribe_cooldown 2.0 能再次被勾引的冷却时间(秒)
列表 bribe_items 能用来勾引该实体的物品列表


minecraft:inventory

Defines this entity's inventory properties.

Parameters
Type Name Default Value Description
String container_type none Type of container this entity has. Can be horse, minecart_chest, minecart_hopper, inventory, container or hopper
Integer inventory_size 5 Number of slots the container has
Boolean can_be_siphoned_from false If true, the contents of this inventory can be removed by a hopper
Boolean private false If true, only the entity can access the inventory
Boolean restrict_to_owner false If true, the entity's inventory can only be accessed by its owner or itself
Integer additional_slots_per_strength 0 Number of slots that this entity can gain per extra strength


minecraft:damage_over_time

Applies defined amount of damage to the entity at specified intervals

Parameters
Type Name Default Value Description
Integer damagePerHurt 1 Amount of damage caused each hurt
Integer timeBetweenHurt 0 Time in seconds between damage


minecraft:damage_sensor

Defines what events to call when this entity is damaged by specific entities or items. Can be either an array or a single instance.

Parameters
Type Name Default Value Description
List on_damage List of triggers with the events to call when taking this specific kind of damage, allows specifying filters for entity definitions and events
Boolean deals_damage true If true, the damage dealt to the entity will take away health from it, set to false to make the entity ignore that damage
String cause Type of damage that triggers this set of events


minecraft:despawn

Despawns the associated Actor immediately or when the optional filter evaluates to true.

Parameters
Type Name Default Value Description
Minecraft Filter filters The list of conditions that must be satisfied before the Actor is despawned
Boolean remove_child_entities false If true, all entities linked to this entity in a child relationship (eg. leashed) will also be despawned


minecraft:environment_sensor

Creates a trigger based on environment conditions.

Parameters
Type Name Default Value Description
List on_environment The list of triggers that fire when the environment conditions match the given filter criteria.


minecraft:equippable

Defines an entity's behavior for having items equipped to it

Parameters
Type Name Default Value Description
List slots List of slots and the item that can be equipped
Parameters
Type Name Default Value Description
Integer slot 0 The slot number of this slot
List accepted_items The list of items that can go in this slot
String item Identifier of the item that can be equipped for this slot
String interact_text Text to be displayed when the entity can be equipped with this item when playing with Touch-screen controls
String on_equip Event to trigger when this entity is equipped with this item
String on_unequip Event to trigger when this item is removed from this entity


minecraft:explode

Defines how the entity explodes.

Parameters
Type Name Default Value Description
Range [a, b] fuseLength [0.0, 0.0] The range for the random amount of time the fuse will be lit before exploding, a negative value means the explosion will be immediate
Decimal power 3.0 The radius of the explosion in blocks and the amount of damage the explosion deals
Decimal maxResistance Infinite A blocks explosion resistance will be capped at this value when an explosion occurs
Boolean fuseLit false If true, the fuse is already lit when this component is added to the entity
Boolean causesFire false If true, blocks in the explosion radius will be set on fire
Boolean breaks_blocks true If true, the explosion will destroy blocks in the explosion radius
Boolean fireAffectedByGriefing false If true, whether the explosion causes fire is affected by the mob griefing game rule
Boolean destroyAffectedByGriefing false If true, whether the explosion breaks blocks is affected by the mob griefing game rule


minecraft:navigation.float

Allows this entity to generate paths by flying around the air like the regular Ghast.

Parameters
Type Name Default Value Description
Boolean can_path_over_water false Tells the pathfinder whether or not it can travel on the surface of the water
Boolean can_sink true Tells the pathfinder whether or not it will be pulled down by gravity while in water
Boolean avoid_sun false Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths
Boolean can_pass_doors true Whether a path can be created through a door
Boolean can_open_doors false Tells the pathfinder that it can path through a closed door assuming the AI will open the door
Boolean can_break_doors false Tells the pathfinder that it can path through a closed door and break it
Boolean avoid_water false Tells the pathfinder to avoid water when creating a path
Boolean avoid_portals false Tells the pathfinder to avoid portals (like nether portals) when finding a path


minecraft:navigation.generic

Allows this entity to generate paths by walking, swimming, flying and/or climbing around and jumping up and down a block.

Parameters
Type Name Default Value Description
Boolean can_path_over_water false Tells the pathfinder whether or not it can travel on the surface of the water
Boolean can_sink true Tells the pathfinder whether or not it will be pulled down by gravity while in water
Boolean avoid_sun false Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths
Boolean can_pass_doors true Whether a path can be created through a door
Boolean can_open_doors false Tells the pathfinder that it can path through a closed door assuming the AI will open the door
Boolean can_break_doors false Tells the pathfinder that it can path through a closed door and break it
Boolean avoid_water false Tells the pathfinder to avoid water when creating a path
Boolean avoid_portals false Tells the pathfinder to avoid portals (like nether portals) when finding a path


minecraft:healable

Defines the interactions with this entity for healing it.

Parameters
Type Name Default Value Description
Array items The array of items that can be used to heal this entity
Parameters
Type Name Default Value Description
String item Item identifier that can be used to heal this entity
Integer heal_amount 1 The amount of health this entity gains when fed this item
Minecraft Filter filters The filter group that defines the conditions for using this item to heal the entity
Boolean force_use false Determines if item can be used regardless of entity being at full health
Minecraft Filter filters The filter group that defines the conditions for this trigger


minecraft:hurt_when_wet

Specifies if an actor is hurt when wet.


minecraft:insomnia

Adds a timer since last rested to see if phantoms should spawn.

Parameters
Type Name Default Value Description
Decimal days_until_insomnia 3.0 Number of days the mob has to stay up until the insomnia effect begins.


minecraft:genetics

Defines the way a mob's genes and alleles are passed on to it's offspring, and how those traits manifest in the child. Compatible parent genes are crossed together, the alleles are handed down from the parents to the child, and any matching genetic variants fire off JSON events to modify the child and express the traits.

Parameters
Type Name Default Value Description
Decimal mutation_rate 0.03125 Chance that an allele will be replaced with a random one instead of the parent's allele during birth.
List genes The list of genes that this entity has and will cross with a partner during breeding.
Parameters
Type Name Default Value Description
String name The name of the gene.
Integer allele_range The range of positive integer allele values for this gene. Spawned mobs will have a random number in this range assigned to them.
Parameters
Type Name Default Value Description
Integer range_min 0 Lower bound of the allele values for this gene.
Integer range_max 0 Upper bound of the allele values for this gene.
List genetic_variants The list of genetic variants for this gene. These check for particular allele combinations and fire events when all of them are satisfied.
Parameters
Type Name Default Value Description
Integer main_allele -1 If this value is non-negative, compare the mob's main allele with this value for a match. Can also be a range of integers.
Integer hidden_allele -1 If this value is non-negative, compare the mob's hidden allele with this value for a match. Can also be a range of integers.
Integer either_allele -1 If this value is non-negative, compare both the mob's main and hidden alleles with this value for a match with either. Can also be a range of integers.
Integer both_allele -1 If this value is non-negative, compare both the mob's main and hidden alleles with this value for a match with both. Can also be a range of integers.
String birth_event Event to run when this mob is created and matches the above allele conditions.


minecraft:giveable

Defines sets of items that can be used to trigger events when used on this entity. The item will also be taken and placed in the entity's inventory.

Parameters
Type Name Default Value Description
Decimal cooldown 0.0 An optional cool down in seconds to prevent spamming interactions.
List items The list of items that can be given to the entity to place in their inventory.
String on_give Event to fire when the correct item is given.


minecraft:interact

Defines interactions with this entity.

Parameters
Type Name Default Value Description
Decimal cooldown 0.0 Time in seconds before this entity can be interacted with again
Boolean swing false If true, the player will do the 'swing' animation when interacting with this entity
Boolean use_item false If true, the interaction will use an item
Integer hurt_item 0 The amount of damage the item will take when used to interact with this entity. A value of 0 means the item won't lose durability
String interact_text Text to show when the player is able to interact in this way with this entity when playing with Touch-screen controls
JSON Object add_items Loot table with items to add to the player's inventory upon successful interaction
Parameters
Type Name Default Value Description
String table File path, relative to the Behavior Pack's path, to the loot table file
JSON Object spawn_items Loot table with items to drop on the ground upon successful interaction
Parameters
Type Name Default Value Description
String table File path, relative to the Behavior Pack's path, to the loot table file
String transform_to_item The item used will transform to this item upon successful interaction. Format: itemName:auxValue
String play_sounds List of sounds to play when the interaction occurs
String spawn_entities List of entities to spawn when the interaction occurs
String on_interact Event to fire when the interaction occurs
JSON Object particle_on_start Particle effect that will be triggered at the start of the interaction
particle_type 

The type of particle that will be spawned


particle_y_offset 

Will offset the particle this amount in the y direction


particle_offset_towards_interactor 

Whether or not the particle will appear closer to who performed the interaction



minecraft:leashable

Allows this entity to be leashed and Defines the conditions and events for this entity when is leashed.

Parameters
Type Name Default Value Description
Decimal soft_distance 4.0 Distance in blocks at which the 'spring' effect starts acting to keep this entity close to the entity that leashed it
Decimal hard_distance 6.0 Distance in blocks at which the leash stiffens, restricting movement
Decimal max_distance 10.0 Distance in blocks at which the leash breaks
String on_leash Event to call when this entity is leashed
String on_unleash Event to call when this entity is unleashed
Boolean can_be_stolen false If true, players can leash this entity even if it is already leashed to another mob


minecraft:lookat

Defines the behavior when another entity looks at this entity.

Parameters
Type Name Default Value Description
Boolean setTarget true If true, this entity will set the attack target as the entity that looked at it
Decimal searchRadius 10.0 Maximum distance this entity will look for another entity looking at it
Boolean mAllowInvulnerable false If true, invulnerable entities (e.g. Players in creative mode) are considered valid targets
Range [a, b] look_cooldown [0.0, 0.0] The range for the random amount of time during which the entity is 'cooling down' and won't get angered or look for a target
Minecraft Filter filters player Defines the entities that can trigger this component
String look_event The event identifier to run when the entities specified in filters look at this entity


minecraft:managed_wandering_trader

This component is used to implement part of the Wandering Trader behavior


minecraft:tamemount

Allows the Entity to be tamed by mounting it.

Parameters
Type Name Default Value Description
Integer minTemper 0 The minimum value for the entity's random starting temper
Integer maxTemper 100 The maximum value for the entity's random starting temper
String feed_text The text that shows in the feeding interact button
String ride_text The text that shows in the riding interact button
Integer attemptTemperMod 5 The amount the entity's temper will increase when mounted
JSON Object feedItems The list of items that can be used to increase the entity's temper and speed up the taming process
Parameters
Type Name Default Value Description
String item Name of the item this entity likes and can be used to increase this entity's temper
Decimal temperMod 0.0 The amount of temper this entity gains when fed this item
JSON Object autoRejectItems The list of items that, if carried while interacting with the entity, will anger it
Parameters
Type Name Default Value Description
String item Name of the item this entity dislikes and will cause it to get angry if used while untamed
String tame_event Event that triggers when the entity becomes tamed


minecraft:movement.sway

This move control causes the mob to sway side to side giving the impression it is swimming.

Parameters
Type Name Default Value Description
Decimal max_turn 30.0 The maximum number in degrees the mob can turn per tick.


minecraft:movement.generic

This move control allows a mob to fly, swim, climb, etc.

Parameters
Type Name Default Value Description
Decimal max_turn 30.0 The maximum number in degrees the mob can turn per tick.


minecraft:movement.skip

This move control causes the mob to hop as it moves.

Parameters
Type Name Default Value Description
Decimal max_turn 30.0 The maximum number in degrees the mob can turn per tick.


minecraft:movement.fly

This move control causes the mob to fly.

Parameters
Type Name Default Value Description
Decimal max_turn 30.0 The maximum number in degrees the mob can turn per tick.


minecraft:movement.amphibious

This move control allows the mob to swim in water and walk on land.

Parameters
Type Name Default Value Description
Decimal max_turn 30.0 The maximum number in degrees the mob can turn per tick.


minecraft:nameable

Allows this entity to be named (e.g. using a name tag)

Parameters
Type Name Default Value Description
JSON Object name_actions Describes the special names for this entity and the events to call when the entity acquires those names
Parameters
Type Name Default Value Description
String on_named Event to be called when this entity acquires the name specified in 'name_filter'
String name_filter List of special names that will cause the events defined in 'on_named' to fire
String default_trigger Trigger to run when the entity gets named
Boolean alwaysShow false If true, the name will always be shown
Boolean allowNameTagRenaming true If true, this entity can be renamed with name tags


minecraft:navigation.walk

Allows this entity to generate paths by walking around and jumping up and down a block like regular mobs.

Parameters
Type Name Default Value Description
Boolean can_path_over_water false Tells the pathfinder whether or not it can travel on the surface of the water
Boolean can_sink true Tells the pathfinder whether or not it will be pulled down by gravity while in water
Boolean avoid_sun false Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths
Boolean can_pass_doors true Whether a path can be created through a door
Boolean can_open_doors false Tells the pathfinder that it can path through a closed door assuming the AI will open the door
Boolean can_break_doors false Tells the pathfinder that it can path through a closed door and break it
Boolean avoid_water false Tells the pathfinder to avoid water when creating a path
Boolean avoid_portals false Tells the pathfinder to avoid portals (like nether portals) when finding a path


minecraft:peek

Defines the entity's 'peek' behavior, defining the events that should be called during it

Parameters
Type Name Default Value Description
String on_open Event to call when the entity starts peeking
String on_close Event to call when the entity is done peeking
String on_target_open Event to call when the entity's target entity starts peeking


minecraft:preferred_path

Specifies costing information for mobs that prefer to walk on preferred paths.

Parameters
Type Name Default Value Description
Integer max_fall_blocks 3 Distance mob can fall without taking damage
Integer jump_cost 0 Added cost for jumping up a node
Decimal default_block_cost 0 Cost for non-preferred blocks
List preferred_path_blocks A list of blocks with their associated cost


minecraft:projectile

Allows the entity to be a thrown entity.

Parameters
Type Name Default Value Description
Decimal gravity 0.05 The gravity applied to this entity when thrown. The higher the value, the faster the entity falls
String particle iconcrack Particle to use upon collision
Boolean reflectOnHurt false If true, this entity will be reflected back when hit
Boolean destroyOnHurt false If true, this entity will be destroyed when hit
Vector [a, b, c] offset [0.0, 0.5, 0.0] The offset from the entity's anchor where the projectile will spawn
Decimal power 1.3 Determines the velocity of the projectile
Decimal angleoffset 0.0 Determines the angle at which the projectile is thrown
Decimal uncertaintyBase 0.0 The base accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel * uncertaintyMultiplier
Decimal uncertaintyMultiplier 0.0 Determines how much difficulty affects accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel * uncertaintyMultiplier
Boolean critParticleOnHurt false If true, the projectile will produce additional particles when a critical hit happens
Boolean knockback true If true, the projectile will knock back the entity it hits
String filter Entity Definitions defined here can't be hurt by the projectile
Boolean semirandomdiffdamage false If true, damage will be randomized based on damage and speed
Decimal onFireTime 5.0 Time in seconds that the entity hit will be on fire for
Boolean catchFire false If true, the entity hit will be set on fire
Boolean lightning false If true, the entity hit will be struck by lightning
Boolean fireAffectedByGriefing false If true, whether the projectile causes fire is affected by the mob griefing game rule
Integer potionEffect -1 Defines the effect the arrow will apply to the entity it hits
Decimal splashRange 4.0 Radius in blocks of the 'splash' effect
Boolean splashPotion false If true, the projectile will be treated like a splash potion
Boolean isdangerous false If true, the projectile will be treated as dangerous to the players
Boolean shoottarget true If true, the projectile will be shot towards the target of the entity firing it
String shootSound The sound that plays when the projectile is shot
String hitSound The sound that plays when the projectile hits something
Decimal inertia 0.99 The fraction of the projectile's speed maintained every frame while traveling in air
Decimal liquid_inertia 0.6 The fraction of the projectile's speed maintained every frame while traveling in water
Boolean homing false If true, the projectile homes in to the nearest entity
Boolean shouldbounce false If true, the projectile will bounce upon hit
Boolean multipletargets true If true, the projectile can hit multiple entities per flight


minecraft:rail_sensor

Defines the behavior of the entity when the rail gets activated or deactivated.

Parameters
Type Name Default Value Description
Boolean check_block_types false If true, on tick this entity will trigger its on_deactivate behavior
Boolean tick_command_block_on_activate true If true, command blocks will start ticking when passing over an activated rail
Boolean tick_command_block_on_deactivate false If false, command blocks will stop ticking when passing over a deactivated rail
Boolean eject_on_activate true If true, this entity will eject all of its riders when it passes over an activated rail
Boolean eject_on_deactivate false If true, this entity will eject all of its riders when it passes over a deactivated rail
String on_activate Event to call when the rail is activated
String on_deactivate Event to call when the rail is deactivated


minecraft:rail_movement

Defines the entity's movement on the rails. An entity with this component is only allowed to move on the rail.

Parameters
Type Name Default Value Description
Decimal max_speed 0.4 Maximum speed that this entity will move at when on the rail


minecraft:rideable

Determines whether this entity can be ridden. Allows specifying the different seat positions and quantity.

Parameters
Type Name Default Value Description
Integer seat_count 1 The number of entities that can ride this entity at the same time
Boolean crouching_skip_interact true If true, this entity can't be interacted with if the entity interacting with it is crouching
String interact_text The text to display when the player can interact with the entity when playing with Touch-screen controls
List family_types List of entities that can ride this entity
Integer controlling_seat 0 The seat that designates the driver of the entity
Boolean pull_in_entities false If true, this entity will pull in entities that are in the correct family_types into any available seats
Boolean rider_can_interact false If true, this entity will be picked when looked at by the rider
List seats The list of positions and number of riders for each position for entities riding this entity
Parameters
Type Name Default Value Description
Vector [a, b, c] position [0.0, 0.0, 0.0] Position of this seat relative to this entity's position
Integer min_rider_count 0 Defines the minimum number of riders that need to be riding this entity before this seat can be used
Integer max_rider_count 0 Defines the maximum number of riders that can be riding this entity for this seat to be valid
Decimal rotate_rider_by 0.0 Offset to rotate riders by
Decimal lock_rider_rotation 181.0 Angle in degrees that a rider is allowed to rotate while riding this entity. Omit this property for no limit


minecraft:scale_by_age

Defines the entity's size interpolation based on the entity's age.

Parameters
Type Name Default Value Description
Decimal start_scale 1.0 Initial scale of the newborn entity
Decimal end_scale 1.0 Ending scale of the entity when it's fully grown


minecraft:sittable

Defines the entity's 'sit' state.

Parameters
Type Name Default Value Description
String sit_event Event to run when the entity enters the 'sit' state
String stand_event Event to run when the entity exits the 'sit' state


minecraft:movement.jump

Move control that causes the mob to jump as it moves with a specified delay between jumps.

Parameters
Type Name Default Value Description
Decimal max_turn 30.0 The maximum number in degrees the mob can turn per tick.
Range [a, b] jump_delay [0.0, 0.0] Delay after landing when using the slime move control.


minecraft:movement.basic

This component accents the movement of an entity.

Parameters
Type Name Default Value Description
Decimal max_turn 30.0 The maximum number in degrees the mob can turn per tick.


minecraft:spawn_entity

Adds a timer after which this entity will spawn another entity or item (similar to vanilla's chicken's egg-laying behavior).

Parameters
Type Name Default Value Description
Boolean should_leash false If true, this the spawned entity will be leashed to the parent
Integer num_to_spawn 1 The number of entities of this type to spawn each time that this triggers
Integer min_wait_time 300 Minimum amount of time to randomly wait in seconds before another entity is spawned
Integer max_wait_time 600 Maximum amount of time to randomly wait in seconds before another entity is spawned
String spawn_sound plop Identifier of the sound effect to play when the entity is spawned
String spawn_item egg Item identifier of the item to spawn
String spawn_entity Identifier of the entity to spawn, leave empty to spawn the item defined above instead
String spawn_method born Method to use to spawn the entity
String spawn_event minecraft:entity_born Event to call when the entity is spawned
Minecraft Filter filters If present, the specified entity will only spawn if the filter evaluates to true
Boolean single_use false If true, this component will only ever spawn the specified entity once


minecraft:shareables

Defines a list of items the mob wants to share. Each item must have the following parameters:

Parameters
Type Name Default Value Description
List items List of items that the entity wants to share
item 

The name of the item


want_amount 

Number of this item this entity wants to share


surplus_amount 

Number of this item considered extra that the entity wants to share


craft_into 

Defines the item this entity wants to craft with the item defined above. Should be an item name



minecraft:shooter

Defines the entity's ranged attack behavior.

Parameters
Type Name Default Value Description
String def Entity definition to use as projectile for the ranged attack. The entity definition must have the projectile component to be able to be shot as a projectile
Integer auxVal -1 ID of the Potion effect to be applied on hit


minecraft:tameable

Defines the rules for a mob to be tamed by the player.

Parameters
Type Name Default Value Description
Decimal probability 1.0 The chance of taming the entity with each item use between 0.0 and 1.0, where 1.0 is 100%
List tameItems The list of items that can be used to tame this entity
String tame_event Event to run when this entity becomes tamed


minecraft:target_nearby_sensor

Defines the entity's range within which it can see or sense other entities to target them.

Parameters
Type Name Default Value Description
Decimal inside_range 1.0 Maximum distance in blocks that another entity will be considered in the 'inside' range
Decimal outside_range 5.0 Maximum distance in blocks that another entity will be considered in the 'outside' range
String on_inside_range Event to call when an entity gets in the inside range. Can specify 'event' for the name of the event and 'target' for the target of the event
String on_outside_range Event to call when an entity gets in the outside range. Can specify 'event' for the name of the event and 'target' for the target of the event


minecraft:teleport

Defines an entity's teleporting behavior.

Parameters
Type Name Default Value Description
Boolean randomTeleports true If true, the entity will teleport randomly
Decimal minRandomTeleportTime 0.0 Minimum amount of time in seconds between random teleports
Decimal maxRandomTeleportTime 20.0 Maximum amount of time in seconds between random teleports
Vector [a, b, c] randomTeleportCube [32.0, 16.0, 32.0] Entity will teleport to a random position within the area defined by this cube
Decimal targetDistance 16.0 Maximum distance the entity will teleport when chasing a target
Decimal target_teleport_chance 1.0 The chance that the entity will teleport between 0.0 and 1.0. 1.0 means 100%
Decimal lightTeleportChance 0.01 Modifies the chance that the entity will teleport if the entity is in daylight
Decimal darkTeleportChance 0.01 Modifies the chance that the entity will teleport if the entity is in darkness


minecraft:tick_world

Defines if the entity ticks the world and the radius around it to tick.

Parameters
Type Name Default Value Description
Positive Integer radius 2 The area around the entity to tick. Default: 2. Allowed range: 2-6.
Decimal distance_to_players 128 The distance at which the closest player has to be before this entity despawns. This option will be ignored if never_despawn is true. Min: 128 blocks.
Boolean never_despawn true If true, this entity will not despawn even if players are far away. If false, distance_to_players will be used to determine when to despawn.


minecraft:timer

Adds a timer after which an event will fire.

Parameters
Type Name Default Value Description
Boolean looping true If true, the timer will restart every time after it fires
Boolean randomInterval true If true, the amount of time on the timer will be random between the min and max values specified in time
Range [a, b] time [0.0, 0.0] Amount of time in seconds for the timer. Can be specified as a number or a pair of numbers (min and max). Incompatible with random_time_choices.
String time_down_event Event to fire when the time on the timer runs out
List random_time_choices [ ] This is a list of objects, representing one value in seconds that can be picked before firing the event and an optional weight. Incompatible with time.


minecraft:trade_table

Defines this entity's ability to trade with players.

Parameters
Type Name Default Value Description
String display_name Name to be displayed while trading with this entity
String table File path relative to the resource pack root for this entity's trades


minecraft:transformation

Defines an entity's transformation from the current definition into another

Parameters
Type Name Default Value Description
String begin_transform_sound Sound to play when the transformation starts
String transformation_sound Sound to play when the entity is done transforming
String into Entity Definition that this entity will transform into
Boolean drop_equipment Cause the entity to drop all equipment upon transformation
JSON Object add List of components to add to the entity after the transformation
Parameters
Type Name Default Value Description
List component_groups Names of component groups to add
JSON Object delay Defines the properties of the delay for the transformation
Parameters
Type Name Default Value Description
Decimal value 0.0 Time in seconds before the entity transforms
Decimal block_assist_chance 0.0 Chance that the entity will look for nearby blocks that can speed up the transformation. Value must be between 0.0 and 1.0
Integer block_radius 0 Distance in Blocks that the entity will search for blocks that can help the transformation
Integer block_max 0 Maximum number of blocks the entity will look for to aid in the transformation. If not defined or set to 0, it will be set to the block radius
Decimal block_chance 0.0 Chance that, once a block is found, will help speed up the transformation
List block_types List of blocks that can help the transformation of this entity
Boolean keep_owner If this entity is owned by another entity, it should remain owned after transformation.


minecraft:trusting

Defines the rules for a mob to trust players.

Parameters
Type Name Default Value Description
Decimal probability 1.0 The chance of the entity trusting with each item use between 0.0 and 1.0, where 1.0 is 100%
List trust_items The list of items that can be used to get the entity to trust players
String trust_event Event to run when this entity becomes trusting


minecraft:navigation.climb

Allows this entity to generate paths that include vertical walls like the vanilla Spiders do.

Parameters
Type Name Default Value Description
Boolean can_path_over_water false Tells the pathfinder whether or not it can travel on the surface of the water
Boolean can_sink true Tells the pathfinder whether or not it will be pulled down by gravity while in water
Boolean avoid_sun false Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths
Boolean can_pass_doors true Whether a path can be created through a door
Boolean can_open_doors false Tells the pathfinder that it can path through a closed door assuming the AI will open the door
Boolean can_break_doors false Tells the pathfinder that it can path through a closed door and break it
Boolean avoid_water false Tells the pathfinder to avoid water when creating a path
Boolean avoid_portals false Tells the pathfinder to avoid portals (like nether portals) when finding a path


minecraft:navigation.swim

Allows this entity to generate paths that include water.

Parameters
Type Name Default Value Description
Boolean can_path_over_water false Tells the pathfinder whether or not it can travel on the surface of the water
Boolean can_sink true Tells the pathfinder whether or not it will be pulled down by gravity while in water
Boolean avoid_sun false Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths
Boolean can_pass_doors true Whether a path can be created through a door
Boolean can_open_doors false Tells the pathfinder that it can path through a closed door assuming the AI will open the door
Boolean can_break_doors false Tells the pathfinder that it can path through a closed door and break it
Boolean avoid_water false Tells the pathfinder to avoid water when creating a path
Boolean avoid_portals false Tells the pathfinder to avoid portals (like nether portals) when finding a path


minecraft:jump.dynamic

Defines a dynamic type jump control that will change jump properties based on the speed modifier of the mob.


minecraft:item_hopper

Determines that this entity is an item hopper


minecraft:jump.static

Gives the entity the ability to jump.

Parameters
Type Name Default Value Description
Decimal jump_power 0.42 The initial vertical velocity for the jump


minecraft:navigation.fly

Allows this entity to generate paths in the air like the vanilla Parrots do.

Parameters
Type Name Default Value Description
Boolean can_path_over_water false Tells the pathfinder whether or not it can travel on the surface of the water
Boolean can_sink true Tells the pathfinder whether or not it will be pulled down by gravity while in water
Boolean avoid_sun false Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths
Boolean can_pass_doors true Whether a path can be created through a door
Boolean can_open_doors false Tells the pathfinder that it can path through a closed door assuming the AI will open the door
Boolean can_break_doors false Tells the pathfinder that it can path through a closed door and break it
Boolean avoid_water false Tells the pathfinder to avoid water when creating a path
Boolean avoid_portals false Tells the pathfinder to avoid portals (like nether portals) when finding a path


minecraft:scaffolding_climber

Allows the player to detect and manuever on the scaffolding block.


minecraft:scheduler

fires off scheduled mob events at time of day events.

Parameters
Type Name Default Value Description
List scheduled_event The list of triggers that fire when the conditions match the given filter criteria. If any filter criteria overlap the first defined event will be picked


minecraft:annotation.open_door

Allows the actor to open doors assuming that that flags set up for the component to use in navigation

Triggers

minecraft:on_death

Only usable by the Ender Dragon. Adds a trigger to call on this entity's death.

Parameters
Type Name Default Value Description
String event The event to run when the conditions for this trigger are met
String target self The target of the event
Minecraft Filter filters The list of conditions for this trigger


minecraft:on_friendly_anger

Adds a trigger that will run when a nearby entity of the same type as this entity becomes Angry.

Parameters
Type Name Default Value Description
String event The event to run when the conditions for this trigger are met
String target self The target of the event
Minecraft Filter filters The list of conditions for this trigger


minecraft:on_hurt

Adds a trigger to call when this entity takes damage.

Parameters
Type Name Default Value Description
String event The event to run when the conditions for this trigger are met
String target self The target of the event
Minecraft Filter filters The list of conditions for this trigger


minecraft:on_hurt_by_player

Adds a trigger to call when this entity is attacked by the player.

Parameters
Type Name Default Value Description
String event The event to run when the conditions for this trigger are met
String target self The target of the event
Minecraft Filter filters The list of conditions for this trigger


minecraft:on_ignite

Adds a trigger to call when this entity is set on fire.

Parameters
Type Name Default Value Description
String event The event to run when the conditions for this trigger are met
String target self The target of the event
Minecraft Filter filters The list of conditions for this trigger


minecraft:on_start_landing

Only usable by the Ender Dragon. Adds a trigger to call when this entity lands.

Parameters
Type Name Default Value Description
String event The event to run when the conditions for this trigger are met
String target self The target of the event
Minecraft Filter filters The list of conditions for this trigger


minecraft:on_start_takeoff

Only usable by the Ender Dragon. Adds a trigger to call when this entity starts flying.

Parameters
Type Name Default Value Description
String event The event to run when the conditions for this trigger are met
String target self The target of the event
Minecraft Filter filters The list of conditions for this trigger


minecraft:on_target_acquired

Adds a trigger to call when this entity finds a target.

Parameters
Type Name Default Value Description
String event The event to run when the conditions for this trigger are met
String target self The target of the event
Minecraft Filter filters The list of conditions for this trigger


minecraft:on_target_escape

Adds a trigger to call when this entity loses the target it currently has.

Parameters
Type Name Default Value Description
String event The event to run when the conditions for this trigger are met
String target self The target of the event
Minecraft Filter filters The list of conditions for this trigger


minecraft:on_wake_with_owner

Adds a trigger to call when this pet's owner awakes after sleeping with the pet.

Parameters
Type Name Default Value Description
String event The event to run when the conditions for this trigger are met
String target self The target of the event
Minecraft Filter filters The list of conditions for this trigger



Built-in Events

Parameters
Name Description
minecraft:entity_transformed Event called on an entity that transforms into another entity.
minecraft:entity_born Event called on an entity that is spawned through two entities breeding.
minecraft:entity_spawned Event called on an entity that is placed in the level.
minecraft:on_prime Event called on an entity whose fuse is lit and is ready to explode.


ID Lists

Entity Description Properties

Parameters
JSON Name ID
animations 0
scripts 0


Attributes

Parameters
JSON Name ID
minecraft:attack 1651346034
minecraft:spell_effects 523264365
minecraft:strength 648564399
minecraft:strength 648564399


Properties

Parameters
JSON Name ID
minecraft:ambient_sound_interval -1314051310
minecraft:can_climb -550459594
minecraft:can_fly 985724318
minecraft:can_power_jump -763124853
minecraft:collision_box -1277663508
minecraft:color 1069623177
minecraft:color2 0
minecraft:default_look_angle -815556357
minecraft:is_dyeable 1381448355
minecraft:equipment 714661022
minecraft:fire_immune -1071767182
minecraft:type_family -255011285
minecraft:floats_in_liquid 179778474
minecraft:flying_speed -570508595
minecraft:foot_size 1133270874
minecraft:friction_modifier -714364556
minecraft:ground_offset -1816881803
minecraft:is_baby 1853172763
minecraft:is_charged 125340337
minecraft:is_chested -817599379
minecraft:is_ignited 905710223
minecraft:is_saddled 1037901616
minecraft:is_shaking 523951884
minecraft:is_sheared 1154836813
minecraft:is_stackable 1184456737
minecraft:is_tamed 1646421078
minecraft:item_controllable 1868311069
minecraft:loot 1775814032
minecraft:push_through -138030768
minecraft:scale 77854436
minecraft:sound_volume 937951776
minecraft:variant -1789583977
minecraft:mark_variant 663621689
minecraft:walk_animation_speed 972393614
minecraft:wants_jockey 1832515141
minecraft:input_ground_controlled -646415617


Components

Parameters
JSON Name ID
minecraft:burns_in_daylight 1256874605
minecraft:hurt_when_wet 237531867
minecraft:addrider -1014528905
minecraft:ageable 1092934985
minecraft:angry 725411499
minecraft:boostable -8316315
minecraft:annotation.break_door 0
minecraft:breathable -707187232
minecraft:burns_in_daylight 1256874605
minecraft:breedable -1616430100
minecraft:bribeable 0
0
minecraft:inventory 1941951218
minecraft:damage_over_time 0
minecraft:damage_sensor -82616534
minecraft:despawn 0
minecraft:environment_sensor 687748970
minecraft:equippable -1164142226
minecraft:explode -1683058581
minecraft:navigation.float -842998036
minecraft:navigation.generic 0
minecraft:healable -54247424
minecraft:hurt_when_wet 237531867
minecraft:insomnia -300455606
minecraft:genetics -82484670
minecraft:giveable 1739199795
minecraft:interact -1996861528
minecraft:leashable 893445039
minecraft:lookat -1329707008
minecraft:managed_wandering_trader 0
minecraft:tamemount 1615660288
minecraft:movement.sway 0
minecraft:movement.generic 0
minecraft:movement.skip -1828832272
minecraft:movement.fly -1487316136
minecraft:movement.amphibious 0
minecraft:nameable -595398763
minecraft:navigation.walk 1909033775
minecraft:peek -863721039
minecraft:preferred_path 0
minecraft:projectile 1922456869
minecraft:rail_sensor 1273161273
minecraft:rail_movement -78235634
minecraft:rideable 1656173828
minecraft:scale_by_age 64881972
minecraft:sittable -1376274106
minecraft:movement.jump 1256268727
minecraft:movement.basic 3354475
minecraft:spawn_entity 1991964333
minecraft:shareables 1301057082
minecraft:shooter 184150118
minecraft:tameable 932870003
minecraft:target_nearby_sensor 1309819882
minecraft:teleport -1900891127
minecraft:tick_world -381759296
minecraft:timer 1862095863
minecraft:trade_table 50480315
minecraft:transformation -457894577
minecraft:trusting 936499892
minecraft:navigation.climb -1075360945
minecraft:navigation.swim 1908076634
0
minecraft:jump.dynamic 945664737
minecraft:item_hopper -447601772
minecraft:jump.static 1064987526
minecraft:navigation.fly -1997823129
minecraft:scaffolding_climber 169799877
minecraft:scheduler -684492525
minecraft:annotation.open_door 0


Triggers

Parameters
JSON Name ID
minecraft:on_death -49357854
minecraft:on_friendly_anger -1009986313
minecraft:on_hurt -1028603471
minecraft:on_hurt_by_player -599009831
minecraft:on_ignite -1911489054
minecraft:on_start_landing -555648368
minecraft:on_start_takeoff 426083399
minecraft:on_target_acquired 1063277906
minecraft:on_target_escape -1373130027
minecraft:on_wake_with_owner -1543219003

ID列表

组件ID

类型 名称 默认值 ID
minecraft:behavior.avoid_mob_type 386517767
minecraft:behavior.beg 1346418048
minecraft:behavior.break_door -1798237626
minecraft:behavior.stomp_turtle_egg 851839416
minecraft:behavior.breed 51166360
minecraft:behavior.charge_held_item 81480366
minecraft:behavior.defend_village_target 1469600895
minecraft:behavior.door_interact -286762735
minecraft:behavior.eat_block 1972447274
minecraft:behavior.explore_outskirts -1955198366
minecraft:behavior.flee_sun -617664229
minecraft:behavior.float 1758503000
minecraft:behavior.follow_owner 1213259599
minecraft:behavior.follow_parent 2127040136
minecraft:behavior.follow_caravan 9936402
minecraft:behavior.follow_mob -1524701626
minecraft:behavior.go_home -1579225026
minecraft.behavior.scared 0
minecraft:behavior.move_to_water 1886139445
minecraft:behavior.move_to_land -943551837
minecraft.behavior.move_to_poi 0
minecraft.behavior.work 0
minecraft:behavior.random_breach 928528911
minecraft:behavior.nearest_attackable_target -2032255557
minecraft:behavior.hurt_by_target -1710404297
minecraft:behavior.owner_hurt_by_target 530667419
minecraft:behavior.owner_hurt_target 995655261
minecraft:behavior.lay_egg -1207740530
minecraft:behavior.look_at_player -1892159379
minecraft:behavior.look_at_target -885375871
minecraft:behavior.look_at_entity -1735428573
minecraft:behavior.look_at_trading_player -2094605693
minecraft:behavior.mount_pathing 1112137677
minecraft:behavior.move_indoors 2107078532
minecraft:behavior.move_through_village 779377630
minecraft:behavior.move_towards_restriction 1288087401
minecraft:behavior.move_towards_target -166537884
minecraft:behavior.ocelotattack 560197714
minecraft:behavior.ocelot_sit_on_block -1327999383
minecraft:behavior.lay_down -2074934675
minecraft:behavior.offer_flower -885387854
minecraft:behavior.open_door -906200433
minecraft:behavior.panic -169886247
minecraft:behavior.run_around_like_crazy -1390363669
minecraft:behavior.restrict_sun -382716017
minecraft:behavior.restrict_open_door 715583988
minecraft:behavior.random_look_around 1177762851
minecraft:behavior.silverfish_merge_with_stone 321908121
minecraft:behavior.silverfish_wake_up_friends 484391748
minecraft:behavior.stay_while_sitting 1346980478
minecraft:behavior.make_love -1551283431
minecraft:behavior.snacking 875141064
minecraft:behavior.random_sitting 1722716662
minecraft:behavior.melee_attack 1848335663
minecraft:behavior.stomp_attack -1851446496
minecraft:behavior.ranged_attack -2093407250
minecraft:behavior.random_stroll -1643504294
minecraft:behavior.random_swim -1465281278
minecraft:behavior.random_fly -446385505
minecraft:behavior.swim_wander -1576142514
minecraft:behavior.tempt 422904556
minecraft:behavior.trade_interest -574851053
minecraft:behavior.peek 211304085
minecraft:behavior.play -505601580
minecraft:behavior.receive_love 1156694272
minecraft:behavior.take_flower 1218648257
minecraft:behavior.harvest_farm_block 10843010
minecraft:behavior.squid_idle 1741234679
minecraft:behavior.squid_flee 1304043261
minecraft:behavior.squid_move_away_from_ground 892387674
minecraft:behavior.squid_out_of_water -1347598607
minecraft:behavior.squid_dive 1626998843
minecraft:behavior.skeleton_horse_trap 530952387
minecraft:behavior.sleep -1811763
minecraft:behavior.swell -1473132493
minecraft:behavior.dragonholdingpattern 1066617362
minecraft:behavior.dragonlanding -152352492
minecraft:behavior.dragonscanning -1003941066
minecraft:behavior.dragonflaming -865288877
minecraft:behavior.dragontakeoff -1912535317
minecraft:behavior.dragonchargeplayer 1808565780
minecraft:behavior.dragonstrafeplayer -1510265153
minecraft:behavior.dragondeath -1541162059
minecraft:behavior.enderman_leave_block -717580550
minecraft:behavior.enderman_take_block -537294220
minecraft:behavior.leap_at_target 256926956
minecraft:behavior.guardian_attack -579215554
minecraft:behavior.slime_float -1480876341
minecraft:behavior.slime_keep_on_jumping -1844762087
minecraft:behavior.slime_random_direction 1437515506
minecraft:behavior.slime_attack -1315951081
minecraft:behavior.raid_garden -1145687602
minecraft:behavior.inspect_bookshelf 40191182
minecraft:behavior.player_ride_tamed 603869698
minecraft:behavior.find_mount 731306871
minecraft:behavior.controlled_by_player 1633000292
minecraft:behavior.wither_random_attack_pos_goal -528895885
minecraft:behavior.wither_target_highest_damage -1065562072
minecraft:behavior.float_wander -1122048364
minecraft:behavior.trade_with_player -2048563493
minecraft:behavior.summon_entity -2005850647
minecraft:behavior.mingle 385775952
minecraft:behavior.send_event -823429137
minecraft:behavior.charge_attack -1921442265
minecraft:behavior.vex_random_move -1117822165
minecraft:behavior.vex_copy_owner_target -643459543
minecraft:behavior.pickup_items 644287189
minecraft:behavior.share_items 2045906118
minecraft:behavior.find_underwater_treasure -1602192311
minecraft:behavior.circle_around_anchor -698025586
minecraft:behavior.swoop_attack 770804235
minecraft:behavior.pet_sleep_with_owner 1379392240
minecraft:behavior.drop_item_for 1846615759
minecraft:behavior.sneeze 1528584076
minecraft:behavior.roll 817471653
Advertisement