当前位置: 首页 > 知识库问答 >
问题:

JSON行为包代码不起作用-布雷克拉夫特基岩

满伟彦
2023-03-14

一段时间以来,我一直试图让这个Minecraft基岩行为包工作。我使用了一个指南,这样我就可以学习如何制作行为包,但是无论我回顾它多少次,我仍然无法找出问题所在。引用的纹理包工作正常,但行为不起作用。

-雷霆1号。17.34.

-导游。

-编辑器noatpad。

文件中:开发资源包

这是舱单。资源包的json

-开发资源包

{
      "format_version": 2,
      "header": {
        "description": "My First Add-On!",
        "name": "Hello WorldRP",
        "uuid":"9b0e1712-ba26-4d3c-be42-2b6c4d160305",
        "version": [1, 0, 0],
        "min_engine_version": [1, 16, 0]
      },
      "modules": [
        {
          "description": "My First Add-On!",
          "type": "resources",
          "uuid": "f2ccdadd-c9ac-4d53-8daf-a3520537ea7e",
          "version": [1, 0, 0]
        }
      ]
    }

-development_behavior_packs

{
  "format_version": 2,
  "header": {
    "description": "My First Add-On!",
    "name": "Hello WorldBP",
    "uuid":"c3fac618-a713-4516-b1eb-1b9c7c75b1db",
    "version": [1, 0, 0],
    "min_engine_version": [1, 16, 0]
  },
  "modules":
    [
      {
        "description": "My First Add-On!",
          "type": "data",
          "uuid": "e34d68ac-72f2-44c2-a514-b83673f919c0",
          "version": [1, 0, 0]
      }
    ],
  "dependencies": [
    {
      "uuid":"9b0e1712-ba26-4d3c-be42-2b6c4d160305",
      "version":[1,0,0]
    }
 ]
}

-HelloWorldBP

{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:cow",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "minecraft:cow_baby": {
        "minecraft:is_baby": {
        },
        "minecraft:scale": {
          "value":0.5
        },
        "minecraft:ageable": {
          "duration": 1200,
          "feed_items": "wheat",
          "grow_up": {
            "event": "minecraft:ageable_grow_up",
            "target": "self"
          }
        },

        "minecraft:behavior.follow_parent": {
          "priority": 6,
          "speed_multiplier": 1.1
        }
      },

      "minecraft:cow_adult": {
        "minecraft:experience_reward": {
          "on_bred": "Math.Random(1,7)",
          "on_death": "query.last_hit_by_player ? Math.Random(1,3) : 0"
        },
        "minecraft:loot": {
          "table": "loot_tables/entities/cow.json"
        },
        "minecraft:behavior.breed": {
          "priority": 3,
          "speed_multiplier": 1.0
        },
        "minecraft:breedable": {
          "require_tame": false,
          "breed_items": "wheat",
          "breeds_with": {
            "mate_type": "minecraft:cow",
            "baby_type": "minecraft:cow",
            "breed_event": {
              "event": "minecraft:entity_born",
              "target": "baby"
            }
          }
        },
        "minecraft:interact": {
          "interactions": [
            {
              "on_interact": {
                "filters": {
                  "all_of": [
                    { "test": "is_family", "subject" : "other", "value" :  "player"},
                    { "test": "has_equipment", "domain": "hand", "subject": "other", "value": "bucket:0"}
                  ]
                }
              },
              "use_item": true,
              "transform_to_item": "bucket:1",
              "play_sounds": "milk",
              "interact_text": "action.interact.milk"
            }
          ]
        }
      }
    },

    "components": {
  "minecraft:type_family": {
    "family": [ "cow", "mob" ]
  },
  "minecraft:breathable": {
    "total_supply": 15,
    "suffocate_time": 0
  },
  "minecraft:navigation.walk": {
    "can_path_over_water": true,
    "avoid_water": true,
    "avoid_damage_blocks": true
  },
  "minecraft:movement.basic": {
  },
  "minecraft:jump.static": {
  },
  "minecraft:can_climb": {
  },
  "minecraft:collision_box": {
    "width": 0.9,
    "height": 1.3
  },
  "minecraft:nameable": {
  },
  "minecraft:health": {
    "value": 10,
    "max": 10
  },
  "minecraft:hurt_on_condition": {
    "damage_conditions": [
      {
        "filters": { "test": "in_lava", "subject": "self", "operator": "==", "value": true },
        "cause": "lava",
        "damage_per_tick": 4
      }
    ]
  },
  "minecraft:movement": {
    "value": 0.25
  },
  "minecraft:despawn": {
    "despawn_from_distance": {}
  },
  "minecraft:behavior.float": {
    "priority": 0
  },
  "minecraft:behavior.panic": {
    "priority": 1,
    "speed_multiplier": 1.25
  },
  "minecraft:behavior.mount_pathing": {
    "priority": 2,
    "speed_multiplier": 1.5,
    "target_dist": 0.0,
    "track_target": true
  },
  "minecraft:behavior.breed": {
    "priority": 3,
    "speed_multiplier": 1.0
  },
  "minecraft:behavior.tempt": {
    "priority": 4,
    "speed_multiplier": 1.25,
    "items": [
      "wheat"
    ]
  },
  "minecraft:behavior.follow_parent": {
    "priority": 5,
    "speed_multiplier": 1.1
  },
  "minecraft:behavior.random_stroll": {
    "priority": 6,
    "speed_multiplier": 0.8
  },
  "minecraft:behavior.look_at_player": {
    "priority": 7,
    "look_distance": 6.0,
    "probability": 0.02
  },
  "minecraft:behavior.random_look_around": {
    "priority": 9
  },
  "minecraft:leashable": {
    "soft_distance": 4.0,
    "hard_distance": 6.0,
    "max_distance": 10.0
  },
  "minecraft:balloonable": {
  },
  "minecraft:rideable": {
    "seat_count": 1,
    "family_types": [
      "zombie"
    ],
    "seats": {
      "position": [ 0.0, 1.105, 0.0 ]
    }
  },
  "minecraft:physics": {
  },
  "minecraft:pushable": {
    "is_pushable": true,
    "is_pushable_by_piston": true
  },
  "minecraft:conditional_bandwidth_optimization": {
  },
  "minecraft:behavior.nearest_attackable_target":{
    "priority": 2,
    "must_see":true,
    "reselect_targets": true,
    "within_radius": 25.0,
    "entity_types":[
      {
        "filters":{
          "test": "is_family", "subject": "other", "value": "player"
        },
        "max_dist":32
      }
    ]
  },
  "minecraft:behavior.melee_attack": {
    "priority": 3
  },
  "minecraft:attack":{
    "damage": 3
  }
},
    "events": {
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "weight": 95,
            "trigger": "minecraft:spawn_adult"
          },
          {
            "weight": 5,
            "add": {
              "component_groups": [
                "minecraft:cow_baby"
              ]
            }
          }
        ]
      },

      "minecraft:entity_born": {
        "add": {
          "component_groups": [
            "minecraft:cow_baby"
          ]
        }
      },

      "minecraft:entity_transformed": {
        "remove": {
        },
        "add": {
          "component_groups": [
            "minecraft:cow_adult"
          ]
        }
      },

      "minecraft:ageable_grow_up": {
        "remove": {
          "component_groups": [
            "minecraft:cow_baby"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:cow_adult"
          ]
        }
      },

      "minecraft:spawn_adult": {
        "add": {
          "component_groups": [
            "minecraft:cow_adult"
          ]
        }
      }
    }
  }
}

我不知道需要什么来解决这个问题,所以我只是抛弃了一切,希望没问题。

共有1个答案

羊舌承
2023-03-14

实现实验特性。过了一天再去想,我不会意识到这就是我所要做的一切。

 类似资料:
  • 我试图测试集合中是否有toString()方法返回特定字符串的项。我尝试使用优秀的Hamcrest匹配类,通过将contains与,但不知何故,它的无法匹配项目,即使该项目存在于集合中。 这里有一个例子: 上述断言是不成功的。这是信息: 看起来像是配对者。contains matcher尝试在列表上迭代,但matcher失败。hasToString matcher在第一项中失败,并使迭代的其余部分

  • 我想了两个小时,为什么这段代码不能产生预期的结果。如果我输入3个整数,比如3、4和5,它应该给出所有27个可能的和(假设数字可以是正的、负的或零) 因此,它应该产生以下内容: -3-4-5=-12 -3-4 0 = -7 -4-4 5=3 等等

  • 问题内容: 我一直在试图弄清楚为什么我按下按钮时布尔值没有改变,而当我手动改变它时却起作用了,但是它什么也没做。我试图按照教程学习这个词,但是它们不起作用。有人可以指出我要去哪里了吗? 感谢您的所有帮助,当我尝试建议的代码但没有成功时,我返回并更改了菜单。以前,我使用onClick制作了一个按钮来创建菜单,当使用代码创建图标时,我之前编写的代码可以正常工作。希望这对我以外的人有帮助,所以我不会觉得

  • 我有一个问题的角色移动pyplay。我想做的是能够按住钥匙,让精灵移动。但是,我必须继续敲击键让精灵移动。任何帮助将不胜感激!这是我的代码: 谢谢

  • 问题内容: 我正在尝试编写关于弹跳球的代码,但是我仍然沉迷于如何 使弹跳球。该代码似乎是正确的,日食没有错误消息 ,但是球还是没有动。任何帮助/提示表示赞赏。 这是我的代码: 问题答案: 基本上,什么都没有移动。 每次滴答作响,您要做的就是重新粉刷。 您需要将移动逻辑移至已注册的方法Timer 更像… 这样,每次Timer打勾时,您都在相应地更新球的位置… 更新了工作示例 我做了两个更改。我将设置

  • 我正试图使用Kryo库来执行对象的深度复制,但我遇到了一个小问题。我想深度复制一个没有瞬态变量的对象。我知道可以将用于,如下所示: 但是我必须为每个类设置一个新的。我可以从Kryo获得一个默认的,并在那里设置吗?我尝试了类似的解决方案,但它什么也做不到: