Behavior packs minecraft pe что это

Обновлено: 06.07.2024

Before building your first Add-On, you will need to create a pack in order to add any custom content in Minecraft: Bedrock Edition. There are two types of packs that a creator can make; resource and behavior packs. This tutorial will go over how behavior packs are created and how to add a series of attacking behaviors to an in-game cow mob.

In this tutorial, you will learn the following:

  • Dependency links between Resource Packs and Behavior Packs.
  • What components are and how they are used to define Minecraft mobs.
  • How to add behaviors to an existing mob.

Requirements

It’s recommended that the following be completed before beginning this tutorial.

Зачем его использовать?

byHaviour помогает значительно ускорить ваш рабочий процесс при работе с пакетами поведения. Это, по сути, индивидуальный редактор JSON, предназначенный для редактирования файлов сущностей, лута и торговли, хотя и поддерживает все файлы JSON. Радость работы с редактором JSON заключается в том, что вы можете не беспокоиться о синтаксических ошибках.

Он включает интеллектуальные и динамические предложения и автозаполнение, что означает, что вы можете легко писать все файлы, задействуя лишь несколько нажатий клавиш. Вы также можете загружать пакеты, отображая обзорную страницу с удобным списком всех объектов в пакете.

Редактор Behaviour Pack для Minecraft: Bedrock Edition

Это случилось! Теперь вы можете загрузить первую версию моего бесплатного редактора пакетов поведения byHaviour! Обязательно ознакомьтесь со всеми его удобными функциями: динамическими предложениями, комментариями, темами, обзором пакетов и многое другое!

Автор: byAdam

Building the Behavior Pack

A behavior pack is a type of pack that allows creators to add, remove or alter gameplay behavior of entities within Minecraft: Bedrock Edition. Within those entity files, behaviors are what drive each entity to perform certain actions, such as a flock of chickens following a feather or whether a zombie will attack a player or another entity.

Behaviors give creators the ability to change the way entities can act in the world. In this section, you will set up a folder for a new Behavior Pack called HelloWorldBP.

Image of Hello World BP folder located in the behavior pack folder

  1. Open your game location folder com.mojang.
  2. Double-click on the folder development_behavior_packs.
  3. Right-click in the File Explorer window and select New and then Folder to create a new folder.
  4. Name the new folder HelloWorldBP.
  5. Double-click on HelloWorldBP to open the folder.

The Manifest File

In order to load a behavior pack into Minecraft, a manifest file will need to be generated. The manifest file is similar to the one created for a Resource Pack, but has a new section that will need to be added in.

Image of the manifest.json file located within the HelloWorldBP folder

  1. Right-click in the Explorer window and select New, then select Text Document.
  2. Set the name to manifest.json.
    1. You will need to change the file extension from .txt to .json. If your Explorer window does not show file extensions, you can enable File Name Extensions under the View tab.

    For format_version , 2 is used as the value for the manifest.json file. While "1.16.0 or [1.16.0] are used in vanilla manifest files, it is recommended to use the latest "format_version": 2 for custom content.

    Image of UUIDGenerator.net home screen with a custom UUID generated out

    1. Copy and paste a UUID into the Header section. The UUID will need to be pasted between the quotation ("") marks in order to be read correctly.
    2. Reload the webpage in order to generate a new UUID for use in the Modules section.
    3. Copy and paste the new UUID into the Modules section in-between the quotation marks.
    4. Save the manifest file.

    Dependencies

    For a behavior pack, you can add a 3rd section to the manifest.json file called Dependencies. Dependency creates a link between a Behavior pack and a Resource pack via UUID located in the header section of the Resource pack manifest.json. Add a dependency for your helloWorldRP resource pack you previously created and set it to automatically activate when the behavior pack is activated.

    Below is an example of what the completed Behavior Pack Manifest File will look like.

    1. In the example shown above, copy the dependencies section.
    2. Paste the dependency section below the modules section. Use the example above as a reference.
      1. Note the JSON formatting above.

      Дополнения (.zip, .rar, .mcworld, .mcpack, .mcaddon)

      .mcworld, .mcpack, .mcaddon:

      Некоторые дополнения загружаются в виде файла .mcpack / .mcworld. Эти типы файлов автоматизируют процесс установки дополнений и карт.

      Сначала убедитесь, что у вас установлены последние версии FX File Explorer (или любой другой файловый менеджер)!

      Откройте приложение FX File Explorer, как только вы скачаете файл .mcpack или .mcworld.

      Перейдите в папку «Загрузки».

      Найдите файл .mcpack или .mcworld и щелкните по нему, чтобы импортировать в Minecraft Pocket Edition. Экран может на некоторое время потемнеть, просто подождите, пока он загрузится!

      Если вы установили мод, не забудьте применить пакет ресурсов и / или пакет поведения при создании нового мира или редактировании существующего!

      Если загруженный мод имеет формат .ZIP или .RAR, установка будет немного сложнее:

      1. Убедитесь, что вы используете подходящую под мод версию Minecraft Pocket Edition.

      2. Скачайте нужный мод, я покажу установку на примере мода More Chairs.

      3. Затем вам понадобится FX File Explorer (или любое другое приложение для управления файлами), чтобы извлечь скачанный zip-файл. Вы можете найти все скачанные файлы в папке «Загрузки».

      Нажмите на скачанный файл файл архива и держите свой палец, чтобы выбрать его. Затем нажмите кнопку «Еще» в правом нижнем углу. А затем нажмите «Извлечь в».

      Как устанавливать моды для Minecraft Pocket Edition. o_0

      Моды для всех версий Майнкрафта, в том числе и для мобильной, введены в качестве официальной функции игры.

      Существует несколько разных типов модов:

      • Дополнения (.zip, .rar, .mcworld, .mcpack, .mcaddon)
      • ModPE (.js, .modpkg)

      Я расскажу вам как установить каждый из них.

      Adding new behaviors

      Now that you know the 4 areas that define an entity, you will add new behaviors to an existing mob. In this example, you will add the following behaviors:

      • minecraft:behavior.nearest_attackable_target to define what the cow is able to attack.
      • minecraft:behavior.meleeattack to allow every cow the ability to inflict damage on its target.
      • minecraft:attack to define how much damage each attack does.

      minecraft:behavior.nearest_attackable_target

      In order for the cow to attack, it will need to find a target that can be attacked. In this example, you will set the filter to look for player in order to make the cows a hostile mob and attack any player.

      In the sample above, the nearest_attackable_target is a component that handles the behavior for detecting a potential target. The component has the following flags:

      • priority is how important this component is compared to other behaviors. Lower numbers represent a higher priority, meaning that a component with a priority set to 1, will happen before another component set at 4.
      • reselect_targets is a Boolean that allows the entity to re-target the same entity after an attack.
      • within_radius defines a radius around the cow of what targets can be selected
      • entity_types is a collection of arguments that define what type of entity is considered a target.
      • filters is what type of entity the cow will look for.
      • max_dist is the distance in blocks between the cow and the potential target in the filter.
      • must_see is a Boolean that determines if the cow needs to have vision on its target. The cow will have to look directly at the player in order for the cow to consider the player a target.

      minecraft:behavior.melee_attack

      Once the cow is able to locate a target, the next step is to allow an attack using the minecraft:behavior.melee_attack component.

      minecraft:attack

      Now that the cow can look for a target and attack, you will need to add a value to deal damage for each attack.

      In the snippet above, you can see that the component has a single argument. "damage" is set to a value of 3 , meaning every attack will take away 1.5 hearts from a player’s life bar.

      Adding the behaviors

      Now that you know each behavior that is needed to make a cow attack a player, you will now add the behaviors to the cow.json file in the HelloWorldBP/entities folder.

      Copy the following code:

      Navigate to the components container in the cow.json file.

      Below the behavior minecraft:conditional_bandwidth_optimization , after the comma ending the behavior, press Enter to add a new line.

      Paste the code on the new line.

      1. If there is another behavior after minecraft:attack , add a comma after the closing bracket.

      Save the cow.json file.

      Commas are used to separate each behavior within the components section. When adding new behaviors, remember to add commas when necessary.

      Shown below is the completed component's section with with the added behavior.

      Testing the Pack

      Now that the pack has both a manifest file and a modification for the cow entity, you can now launch Minecraft and test your new Add-On. As stated in the Resource Pack, Pack Stacking will work for Behavior Packs as well. This means that content is loaded with any and all vanilla content being loaded first, followed by any additional Add-Ons. Since the cow is using the cow.json namespace, every cow will inherit the new behaviors.

      1. Launch Minecraft.
      2. When Minecraft has launched and reached the main menu, select Play.
      3. Select Create a New World.
      4. Under Settings, scroll down to the Add-On section.
      5. Click on Behavior Packs to see all available packs.
      6. Under all of the packs, select HelloWorldBP to add the pack to the world.
      7. Launch your world.

      What's Next?

      Now that you have learned how to augment existing Minecraft features such as textures and behaviors, it's recommended that you learn how to add new items to Minecraft, starting with a custom block component.

      Changing the dirt block

      With the manifest file completed, you can now start adding custom content to Minecraft. Let’s get started by applying a new texture to the vanilla dirt block.

      Creating the texture

      Now that the folder structure is created, you can now place your custom textures here. A png file is also provided that you can download and place in your folder.

      A PNG file that can be downloaded and used in place of a custom texture made in a photo editor

      1. Open up an image editor such as Paint3D, MS Paint or Photoshop.
        1. In this tutorial, MS Paint will be used.

        You can now design a pattern or any artwork in the editor. In this example, a simple fill color has been added.

        While MS Paint is used for this example for it's quick and easy access, there are a few drawbacks as well.

        • MS Paint does not support alpha channels that are commonly used for transparency effects in Minecraft.
        • MS Paint does not support .tga files types.
        1. When done with your texture, select File and then select Save As a PNG.
        2. Navigate to the blocks folder.
        3. Save the file as dirt.jpg.

        Testing the pack

        Now that the pack has both a manifest file and a texture, you can now launch Minecraft and test your new Add-On.

        Pack Stacking is when content is loaded on top of vanilla content, causing each object that has the same name in both packs to be overwritten by the latest applied pack (in our example, the Dirt texture is overwritten by our custom texture).

        If another pack that uses the dirt.jpg file is loaded after helloWorldBP, then Minecraft will use the latest dirt.jpg that was applied.

        Since the custom texture is named dirt.jpg, the texture will be used on every single dirt block in game.

        Image of Minecraft

        1. Launch Minecraft.
        2. When Minecraft has launched and reached the main menu, select Play.
        3. Select Create a new world.
        4. Under Settings, scroll down to the Add-On section.
        5. Click on resource packs to see all available packs.
        6. Under all of the packs, select HelloWorldRP to add the pack to the world.
        7. Launch your world.

        What's Next?

        With a custom texture now a part of your Minecraft world, its now time to look at behavior packs and how you can alter existing entity behaviors. In the next section, you will learn how to add an aggressive behavior to a normally peaceful cow entity.

        Building the Resource Pack

        In order to create a new resource pack, you will need to create a new folder to contain a manifest file that can be read by Minecraft, and the custom content that will be loaded into the game.

        The Manifest File

        In order to load a resource pack into Minecraft, a manifest file will need to be generated. The manifest file is a JSON file that contains the following information;

        • Description – In-game description of what the resource pack does.
        • Name – In-game name of the resource pack.
        • UUID - Universally Unique Identifier.
        • Version – Version of the resource pack.
        • Minimum Engine Version – Required version of Minecraft that this pack will work in.

        Since the file is written in JSON, Minecraft will be able to parse the information from the file and display it in the Add-On section. Inside the file, the information will be split into two separate sections; header and modules. The header section will contain the overall information for the pack, while modules will contain the dedicated packages information.

        image of newly created JSON file named Manifest located within the HelloWorldRP folder

        1. Right-click in the Explorer window and select New, then select Text Document.
        2. Set the name to manifest.json.
          1. You will need to change the file extension from .txt to .json. If your Explorer window does not show file extensions, you can enable File Name Extensions under the View tab.

          For format_version , 2 is used as the value for the manifest.json file. While "1.16.0 or [1.16.0] are used in vanilla manifest files, it is recommended to use the latest "format_version": 2 for custom content.

          Universally Unique Identifier, or UUID for short, is a unique number used to identify different software. For Minecraft, the UUID is used to define a specific pack and prevent any duplicate software from causing issues. For both header and modules, there will need to be 2 different UUID numbers entered between the quotes. You can use an online UUID Generator such as UUID Generator.

          Image of UUIDGenerator.net home screen with a custom UUID generated out

          1. Copy and paste a UUID into the header section. The UUID will need to be pasted between the quotation ("") marks in order to be read correctly.
          2. Reload the webpage in order to generate a new UUID for use in the Modules section.
          3. Copy and paste the new UUID into the modules section in-between the quotation marks.
          4. Save the manifest file.

          To learn more about how a manifest.json file works, you can view the manifest.json page in the Addons documentation by clicking on the link above.

          Introduction to Resource Packs

          Before building your first Add-On, you will need to create a pack in order to add any custom content in Minecraft: Bedrock Edition. There are two types of packs that a creator can make: resource and behavior packs. In this tutorial, you will learn about resource packs.

          A resource pack is a folder structure that will contain all of your custom models, sounds, textures and any custom content that is made. resource packs are commonly used to add user generated content to Minecraft in order to augment a player's experience.

          In this tutorial, you will learn the following:

          • Understand how a resource pack is created.
          • How a manifest file is created.
          • How custom textures are loaded into Minecraft.
          • The concept of * pack Stacking** when working with Add-On content.

          Requirements

          It’s recommended that the following be completed before beginning this tutorial:

          Что это?

          Entity

          Each character’s behaviors are defined using a json file. For this section, you will copy the cow.json file located in the default vanilla Behavior Pack.

          1. In the HelloWorldBP folder, right-click in the File Explorer window and select New and then Folder to create a new folder.
          2. Name the folder entities.
          3. Verify that you have downloaded the Vanilla Behavior Pack located in the Requirements section of this tutorial.
          4. Unzip the folder in order to access the files within.
          5. Navigate to the entities folder located in the unzipped pack.
          6. Copy the cow.json and paste it into the HelloWorldBP/entities folder.

          Now with a copy of the cow.json file located in the HelloWordBP, you can make changes and edit the behavior of the existing cow mob. Cow.json, like other Minecraft entity json files can be broken down into a series of sections.

          minecraft:entity

          The first section is the minecraft:entity . This container is used to define what the entity is. Description, Components Groups, Components, and Events are contained under the minecraft:entity object. In the cow.json, you can see the following set for its description:

          • identifier is the in-game name used to define an entity.
          • is_spawnable is a Boolean (True/False statement) allowing the option for the entity to be spawned in the world
          • is_summonable is a Boolean allowing players to summon via command interface.
          • is_experimental is a Boolean that flags if the entity is in an experimental state.

          Component Groups

          Component groups are used to help organize and define a collection of behaviors for the entity. Component groups allow for variation in behaviors for similar types of mobs such as creating an adult and a child version of a single mob entity. In cow.json, there are 2 groups: "minecraft:cow_baby" and "minecraft:cow_adult" . Shown below is the cow_baby component group.

          In the cow.json sample shown above, you can see that the "minecraft:cow_baby" has dedicated components under it, controlling the size, its ability to age, and being able to follow something tagged as a parent.

          Components

          Components define behaviors and properties that you can assign to an entity to adapt how they behave.

          In the cow.json, you can see that the first two components are "minecraft:type_family" and "minecraft:breathable" . These components set which family categories the cow belongs to, and how well it can hold its' breath while underwater before taking damage. These are global settings that apply to any minecraft:cow entity regardless if it is a baby or an adult.

          Events

          Events are actions you can take on the entity when a special condition is triggered by the entity's behavior.

          In the cow.json file shown above, an entity_spawned event is defined here in order to spawn either an adult cow or a baby cow in the world.

          • randomize allows the use of defining the odds of the entity spawning in either group. Here, there is a 95/100 chance it could spawn an adult cow or a 5/100 chance to spawn a baby cow. Note that randomize does not work off of a percentage system. Instead, the odds are calculated via the sum of the "weight" definition. If you were to change "weight": 5 , to "weight":25 , it would have a 25/120 chance of spawning.

          Читайте также: