documentation/Mob Equipment

Safe Creeper • Documentation • Mob Equipment

Since Safe Creeper 1.3.4 you can setup custom equipment for mobs. Using this feature you can give zombie’s or any other mob armor or weapons. For example, you can make zombie’s spawn with a sign in their hands enchanted with knockback 10, and put a glass block on their head as a hat. Almost everything is possible using this feature. This feature is a bit complicated to understand, and use. Using this page you can find out how this feature works.

The possibilities

As you know you can set the equipment of mobs when they spawn, using this feature. This feature is more advanced than most other plugins available out there in focus on mob equipment. Of course you can give mobs custom items, like a sword in their hand or armor on their body. All these things have a fully customizable chance, which could all be found in the config files. Each item can have a data value, to give for example, a wool block a color. Each item can also have a durability value, or a drop chance. You can also add enchantments to the items. The durability is used to make a sword pre-damaged. The chance could be used to set the chance, this item can drop when the mob dies. Inside the enchantments part you can add any enchantment you’d like. Each item can contain more than one enchantment. All enchantments have a customizable chance from being attached on the item. Also, the enchantments are unsafe, which means the following. You can add the enchantment ‘Knockback’ with level 20, to a sign. This makes the sign extremely powerful. This isn’t available in vanilla Minecraft, that’s why it’s called an unsafe enchantment.

The appearance

Only a few mobs are able to wear physical stuff. For example, the zombie, the zombie pigman, the skeleton and only a few others are able to wear visible armor, because they are human-like shaped. If you put a block of glass on the head of a zombie, players are able to see the glass block. If, for example, you put this block on the head of the spider, the block won’t be visible. This is caused by Minecraft itself, because this spider doesn’t have a human-shaped body. Although, the gear isn’t visible on spiders for example, they do have effect on the behavior of the spider.

The config structure

Before you are able to use the equipment feature you need to understand the structure used in the config files. This means the structure, how everything should be defined in the config files. At first you have a control for example, we’ll take the ZombieControl for now, as example. This control contains an node called ‘CustomEquipment’, inside this node, everything should be defined. At first you have to create equipment sets, these equipment sets contains the items the mob can wear. For example you can create a regular equipment set, and as addition a rare equipment set. You can give the rare equipment set a chance of 1% to be used. This means that the regular equipment set has a chance of 99% to be used as equipment since ALWAYS one set is chosen. The regular equipment set should contain some regular items. For example, a wooden sword, or just ‘Air’ (item id: 0) which gives the mob empty hands. You can also add some leather armor in here, with a chance of 5% to be used. Inside the rare equipment set you can add more expensive items. For example, diamond swords, more expensive armor and weapons/gear with enchantments. Of course you can randomize the enchantments for one weapon/item, and you can also add a sign as additional weapon, so Safe Creeper will chose one of these to be used for the equipment. Safe Creeper is build out of equipment sets, instead of just some randomized equipment for the following reason: Using these sets you can optionally say that a zombie should spawn in fully diamond armor, and sometimes just in leather armor or just one leather armor part. This is only possible using sets. Otherwise zombies will spawn with leather AND diamond armor which is probably unwanted, this can be prevented using these sets.

Defining equipment sets

It’s actually very easy to setup these equipment sets, once you know how it works. That’s one reason why this documentation page has been created. We will take the zombie control as example. Bellow you can see the default settings from the global.yml config file, included in the download, or automaticly created once Safe Creeper has been installed.

ZombieControl:
     CustomEquipment:
        Enabled: false
        EquipmentSets: {}

The enabled node is used to set if the custom equipment feature is enabled or disable. If you want to disable this feature for a while you only have to change this value, without having to remove all the settings from this feature. Also, this feature has been disabled by default because it doesn’t contain any settings yet. Before you start editing the files, make sure you enable the ZombieControl, otherwise the changes you make won’t take effect! You also have a node called ‘EquipmentSets’, this will contain all the equipment sets you are going to make. The default value is similar to {}, this means that EquipmentSets is an empty list. You have to put these curly brackets after this node when you don’t have anything setup here! Now we are going to add our first set. At first make sure you remove the curly brackets. Each set has a unique name, something important to know is that this name may only contain alphabetical characters, numbers, underscores and dashes. These names are used to separate the different controls. We will call the set we are creating ‘regular_set’, you can also call it ‘set1’ for example. Make sure you put the name between two single quotes, so the config file handler knows you are writing down a name. Bellow you can see an example about how your config file should look like now.

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets:
            regular_set:

Each set have to contain two other nodes called ‘Enabled’ and ‘Chance’. The enabled node is used to set if the current set should be used or not, you can temporary disable a set if you want it to be disabled. The chance node is used to set the usage chance of each node. The chance node works a bit different than you probably expected. If you have two sets, a regular set, and a rare set, with a chance of 9, and 1. The chance works the following. All the chance values from all the used sets are added to each other. So 9 + 1 makes 10. Then a random number is chosen between 1 and 10. This random number chooses the set to be used. So with 9 and 1, the regular set has a chance of 90% (9 out of 10) to be used, and the rare set has a chance of 10% (1 out of 10) to be used. If you change these values to 17 and 3, the total makes 20. So the regular set will be used 85% (17 out of 20) of the items, and the rare one only 17% (3 out of 20) of the times. If you only have one set, you can set the chance to 1. We are going to set the chance of the regular set to 90%, so we should set it to 9. Your config should look similar to this:

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets:
            regular_set:
                Enabled: true
                Chance: 9

Each set should also contain the items to be used in the set. This will be shown in the paragraph called ‘Adding items into sets’, bellow. Now we are going to add a rare set. This is also very easy to use. We will call this set ‘rare_set’, make sure you use the single quotes again. To give this a chance of 10% to be used, you should give this a chance of 1 (1 out of 10). Your config file should look similar to this:

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets: 
            regular_set:
                Enabled: true
                Chance: 9
            rare_set:
                Enabled: true
                Chance: 1

You can add an infinite amount of sets in each equipment feature. Please read the paragraph bellow to learn how to add items to each set.

Adding items into sets

In this example 2 sets are defined called ‘regular_set’ and ‘rare_set’. These sets are defined inside the paragraph called ‘Defining equipment sets’. Inside each set you can set items to use in the hands of the mob, as helmet, as chest plate, as legging and as boots. At first we will add a wooden sword to the regular_set to put into the hands of the zombie. Create a ‘Hands’ node inside the regular_set node, which should look like this:

ZombieControl:
     CustomEquipment:
        Enabled: false
        EquipmentSets: 
            regular_set:
                Enabled: true
                Chance: 9
                Hands:
            rare_set:
                Enabled: true
                Chance: 1

Inside this node we should add the items we want to be put into the hands of the zombie once any spawns. Also, all these items have a unique name, which may only contain alphabetical characters, numbers, underscores and dashes which is similar to the names of sets. We are going to add a wooden sword so we will call this item ‘wooden_sword’, you can also call it ‘item1’ for example. But make sure it’s an unique name. Again, make sure you put the name between single quotes, so the config file handler knows you are talking about a name. Your config should look like this:

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets: 
            regular_set:
                Enabled: true
                Chance: 9
                Hands:
                    wooden_sword:
            rare_set:
                Enabled: true
                Chance: 1

Each item contains some default nodes, named ‘Enabled’, ‘Chance’ and ‘ItemId’. The Enabled node is used to set if the current item may be used, this could be used to temporary disable the usage of an item. The chance node is used to set the chance to be used. And the ItemId node is used to set the type id or item id of the item to be used. The item id of a wooden sword equals to 268. The item id 0 could be used if you want to put nothing in the hands of the zombie. The chance node works very similar to the chance of sets, because ALWAYS one item is chosen to be used. For example if you add two items to the hands node, a wooden_sword and a sign. The chances can be set to 3 and 2. The chances of each items are added to each other, 2 + 3 makes 5. This means that the wooden_sword has a chance to be used of 60% (3 out of 5), and the sign has a chance of 40% (2 out of 5). If you won’t put any item inside the hands node, the default (vanilla) item will be used for zombies. Make sure, that if you won’t use any items, you put two curly brackets like this {} behind the hands node, so the config file hander knows this is an empty list. Your config file should look similar to this:

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets: 
            regular_set:
                Enabled: true
                Chance: 9
                Hands:
                    wooden_sword:
                        Enabled: true
                        Chance: 3
                        ItemId: 268
            rare_set:
                Enabled: true
                Chance: 1

Each item may also contain some optional nodes called ‘ItemData’, ‘ItemDurability’, ‘DropChance’ and ‘Enchantments’. The ItemData node is used to give the item a datavalue, this could be used to put a colored block of wool on the head of a zombie. The ItemDurability node is used to put a already-damaged sword in the hands of a zombie. The DropChance node could be used to set the chance of this item being dropped once the zombie dies. This chance is in percentages, which means that if this value is set to 60, the sword (or other item) has a chance of 60% to drop when the zombie got killed. If you won’t define the chance, the default (vanilla) chance will be used. About enchantments will be talked bellow, in the paragraph called ‘Adding enchantments to items’. Your config file should look similar to this (The ItemData, ItemDurability and the DropChance are optional, but added to the example bellow).

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets: 
            regular_set:
                Enabled: true
                Chance: 9
                Hands:
                    wooden_sword:
                        Enabled: true
                        Chance: 3
                        ItemId: 268
                        ItemData: 0
                        ItemDurability: 0
                        DropChance: 50
            rare_set:
                Enabled: true
                Chance: 1

If we want to add a diamond sword with the same chance and settings to the rare equipment set it would look similar to this:

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets: 
            regular_set:
                Enabled: true
                Chance: 9
                Hands: 
                    wooden_sword:
                        Enabled: true
                        Chance: 3
                        ItemId: 268
                        ItemData: 0
                        ItemDurability: 0
                        DropChance: 50
                    sign:
                        Enabled: true
                        Chance: 2
                        ItemId: 323
                        DropChance: 50
            rare_set:
                Enabled: true
                Chance: 1
                Hands:
                    diamond_sword:
                        Enabled: true
                        Chance: 3
                        ItemId: 276
                        ItemData: 0
                        ItemDurability: 0
                        DropChance: 50

We can also add an additional weapon to the regular set, which will be a sign. We will give this a chance of 2 (2 out of 5). We will name this item ‘sign’. You can also add items as helmet, as chest plate, as leggings and as boost. The nodes for these features are called ‘Head’, ‘Chest’, ‘Legs’, ‘Feet’. If we want to put a blue, or red wool block on the head of the zombie. And a leather chest plate it would look similar to this. (You don’t have to add the Legs and Feet node since they are optional, but if you do add them, you have to put the curly brackets like {} behind it if you won’t put any items in here.)

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets: 
            regular_set:
                Enabled: true
                Chance: 9
                Hands: 
                    wooden_sword:
                        Enabled: true
                        Chance: 3
                        ItemId: 268
                        ItemData: 0
                        ItemDurability: 0
                        DropChance: 50
                    sign:
                        Enabled: true
                        Chance: 2
                        ItemId: 323
                        DropChance: 50
                Head:
                    bluewool:
                        Enabled: true
                        Chance: 1
                        ItemId: 35
                        ItemData: 11
                        DropChance: 0
                    redwool:
                        Enabled: true
                        Chance: 1
                        ItemId: 35
                        ItemData: 14
                        DropChance: 0
                Chest: 
                    leather_chestplate:
                        Enabled: true
                        Chance: 1
                        ItemId: 299
                        DropChance: 50
                Legs: {}
                Feet: {}
            rare_set:
                Enabled: true
                Chance: 1
                Hands:
                    diamond_sword:
                        Enabled: true
                        Chance: 3
                        ItemId: 276
                        ItemData: 0
                        ItemDurability: 0
                        DropChance: 50

Adding enchantments to items

You can also optionally add enchantments to items. Each item may contain more than one enchantment, this is also fully customized. It’s very easy to define these enchantments. For example we have this simplified setup:

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets: 
            regular_set:
                Enabled: true
                Chance: 9
                Hands: 
                    wooden_sword:
                        Enabled: true
                        Chance: 3
                        ItemId: 268

We can add an Knockback enchantment level 2 and a sharpness enchantments level 3 on the sword, with a chance of 30% and 50%. Each enchantment has an unique name which may only contain alphabetical characters, numbers, underscores and dashes. This will separate all enchantments in the list. Make sure you put the name between single quotes to the config handler knows you are talking about a name. Each enchantment contains the node ‘Enabled’, ‘Enchantment’, ‘Chance’ and ‘Level’. The enabled node is used to set if the current enchantment item is enabled, so you can temporary disable an enchantment if you’d like to do so. The ‘Enchantment’ node is used to put the name of the enchantment in. The names aren’t the same as the in-game enchantments name but they are a bit different. On the bottom of the page you can find a table with all the enchantments, called ‘Available Enchantments’. The ‘Chance’ is used to set the chance of this enchantment to be used on the item, which will be 30 and 50 for the items above. The Level node is used to set the level of the enchantment. These enchantments are un-save, that means that you can add a Knockback enchantment with a level of 20 to a sign, with no problems, which isn’t possible in vanilla Minecraft by default. If you add the items told about above your config would look similar to:

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets: 
            regular_set:
                Enabled: true
                Chance: 9
                Hands: 
                    wooden_sword:
                        Enabled: true
                        Chance: 3
                        ItemId: 268
                        Enchantments: 
                            knockback:
                                Enabled: true
                                Enchantment: Knockback
                                Chance: 30
                                Level: 2
                            sharpness:
                                Enabled: true
                                Enchantment: Damage All
                                Chance: 50
                                Level: 3

You can also add a knockback enchantment with level 20 to a sign for example:

ZombieControl:
     CustomEquipment:
        Enabled: true
        EquipmentSets: 
            regular_set:
                Enabled: true
                Chance: 9
                Hands: 
                    sign:
                        Enabled: true
                        Chance: 3
                        ItemId: 323
                        Enchantments: 
                            knockback:
                                Enabled: true
                                Enchantment: Knockback
                                Chance: 100
                                Level: 20

Available enchantments

The table bellow contains three column of enchantments available to use. The first column is the Safe Creeper enchantment name which should be used inside the Enchantments node, the second column is the Bukkit name for the enchantments, this could be used inside the Enchantments node. And the second column contains the vanilla in-game Minecraft enchantment names, which could NOT be used inside the Enchantment node.

Safe Creeper EnchantmentBukkit EnchantmentMinecraft Enchantment
Protection EnvironmentalPROTECTION_ENVIRONMENTALProtection
Protection FirePROTECTION_FIREFire Protection
Protection FallPROTECTION_FALLFeather Falling
Protection ExplosionsPROTECTION_EXPLOSIONSBlast Protection
OxygenOXYGENRespiration
Water WorkerWATER_WORKERAqua Affinity
Damage AllDAMAGE_ALLSharpness
Damage UndeadDAMAGE_UNDEADSmite
Damage ArthropodsDAMAGE_ARTHROPODSBane of Arthropods
KnockbackKNOCKBACKKnockback
Fire AspectFIRE_ASPECTFire Aspect
Loot Bonus MobsLOOT_BONUS_MOBSLooting
Dig SpeedDIG_SPEEDEfficiency
Silk TouchSILK_TOUCHSilk Touch
DurabilityDURABILITYUnbreaking
Loot Bonus BlocksLOOT_BONUS_BLOCKSFortune
ThornsTHRONSThorns
Arrow DamageARROW_DAMAGEPower
Arrow KnockbackARROW_KNOCKBACKPunch
Arrow FireARROW_FIREFlame
Arrow InfiniteARROW_INFINITEInfinity

Questions and Ideas

If you have any questions or idea’s, please ask or apply them on the main page of Safe Creeper.


Comments

Posts Quoted:
Reply
Clear All Quotes