Table of Contents
Pets
The pet system is implemented as follows: in the user's inventory there is a pet slot, and in order to call a pet, the player must put in the slot an object that is associated with the pet. Objects, and properties of pets, which of them will be called, are configured in the file pets.yml
The file pets.yml has the following structure:
# Settings for pets pets: pet1: ... pet2: ... ... ... petN: ... # Pet food settings food: food1: ... food2: ... ... ... foodN: ...
In this case, pet1, pet2, petN, food1, food2 and foodN are the IDs of pets and their food. This identifier is entered in the command to receive a pet or pet food.
Attention: if you change or delete the pet (food) from this file, it will be changed / deleted for all users who have a pet (meal) with this ID.
Step 1: Appearance of the object and pet
Consider the properties that are responsible for the appearance
Property | Values | Description |
---|---|---|
name | Line | Pet's name in the game |
item-name | Line | The title of the pet summoning object |
lore | List of Rows | Description of the object of the pet's call in the game. This can be both an artistic text, and an additional description of the subject. |
item | Texture | The texture that will be used for the summoning item |
skin | Entity Inanimate entities (blocks, etc.) are not allowed | The shape that will be used for the pet in the game |
features | Feature List see below | Peculiarities of the appearance of the pet. Each pet has its own set of features |
Features of appearance are written in the format: “<feature>: <value>”
Let's consider in more detail what creatures have features of appearance:
Being | Feature | Values | Description |
---|---|---|---|
All creatures | BABY | Boolean type Default - false | Is the pet a baby |
PIG SKELETON_HORSE UNDEAD_HORSE MULE DONKEY | SADDLE | Boolean type Default - false | Presence of a saddle |
HORSE | SADDLE | Boolean type Default - false | Presence of a saddle |
CHEST | Boolean type Default - false | The presence of a chest | |
ARMOR | IRON_BARDING GOLD_BARDING DIAMOND_BARDING Default - <empty> | Armor Plated Iron, gold, and diamond, respectively |
|
COLOR | WHITE CREAMY CHESTNUT BROWN BLACK GRAY DARK_BROWN Default - <accidental> | Main color of horse More on the official wiki |
|
STYLE | NONE WHITE WHITEFIELD WHITE_DOTS BLACK_DOTS Default - <accidental> | Additional elements of color More on the official wiki |
|
WOLF | COLLAR | Color Default - RED | Color of the Wolf Collar |
OCELOT | TYPE | WILD_OCELOT BLACK_CAT RED_CAT SIAMESE_CAT Default - WILD_OCELOT | Ocelot and cat More on the official wiki |
ENDERMAN | ITEM | Material Default - <empty> | The item that will keep the Enderman |
RABBIT | TYPE | BLACK BROWN GOLD KILLER_BUNNY PATCHES PEPPER WHITE Default - <accidental> | Revenge of the Rabbit |
SHEEP | SHEARED | Boolean type Default - false | Is sheep sheared? |
COLOR | Color By default - WHITE | Color of sheep's wool |
Example
pet1: name: "&6&lArabian Horse" item-name: "&5&lThe summoning stone of the Arabian horse" lore: - "&e&oRush like the wind!" item: MONSTER_EGG:Zombie # The type of a horse will be used skin: HORSE # We want the horse to be dark brown with white, with a saddle, without a chest and in iron armor features: - "SADDLE: TRUE" - "CHEST: FALSE" - "ARMOR: IRON_BARDING" - "COLOR: DARK_BROWN" - "STYLE: WHITE"
But at the moment we still can not use this pet. We have not yet set some mandatory options, which we will consider in the second step.
Step 2: Pet Characteristics
Let's pass, directly, to giving the pet properties and characteristics.
Property | Values | Description |
---|---|---|
type | COMPANION MOUNT Default - COMPANION | Pet Type The satellite and the horse, respectively |
health | A nonnegative number with a period | The amount of pet health measured in the heart |
speed | A nonnegative number with a period | Pet speed, measured in blocks / sec Reference materials... |
revival | Boolean type Default - true | Can a pet be reborn after death |
cooldown | Integer nonnegative number Default - 0 | Rollback to rebirth in seconds If the pet is not reborn, you do not need to specify |
damage* | A nonnegative number with a period Default - 0 | Damage to the companion. Measured in the heart |
attack-mobs* | Boolean type Default - false | Will the companion attack mobs? |
attack-players* | Boolean type Default - false | Will the companion attack players |
* The property does not apply to the MOUNT pet type |
Example
pet1: name: "&6&lArabian Horse" item-name: "&5&lThe summoning stone of the Arabian horse" lore: - "&e&oRush like the wind!" item: MONSTER_EGG:Zombie skin: HORSE features: - "SADDLE: TRUE" - "CHEST: FALSE" - "ARMOR: IRON_BARDING" - "COLOR: DARK_BROWN" - "STYLE: WHITE" # We make a steed, so choose the appropriate pet type type: MOUNT health: 40 speed: 6.3 # The pet will be reborn 60 seconds after death revival: true cooldown: 60
Let's see what the pet looks like in the game:
And now let's see what the mount looks like:
Step 3: Limitations of pets
Restrictions on the use of pets are done in the same way as for objects (cf. Items)
Пример
pet1: ... ... ... # Write the requirements for the player level: 6 classes: - Soldier - Warrior
We see that the game has limitations on the level and classes:
Step 4: Pet Food
Now we need to somehow replenish our pets, and for this we need to make them food
Property | Values | Description |
---|---|---|
name | Line | Name of the item in the game |
lore | List of Rows | Description of the item in the game |
item | Texture | The texture used for the object |
eaters | Entity List | Pets with the guise from this list will be able to eat this food |
value | A nonnegative number with a period | The amount of health recovered per meal |
Example
We will make oats for our steed.
bone: name: "&f&lOats" lore: - "&e&o- The best oats!" item: WHEAT eaters: - HORSE value: 5
Let's see how the object looks in the game: