Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Armoreablemobs Wiki › Guides › Giving Mobs Custom Items and Weapons on Spawn

Giving Mobs Custom Items and Weapons on Spawn

Armor Slots Cover More Than Armor

The ArmorSlot system is not limited to helmets and chestplates. Any slot name the entity supports can hold an item, including the main hand and off hand. That means you can hand a skeleton a custom bow, give a zombie a sword, or drop a shield into an offhand slot.

Create the Slot

`zenscript

var group = ArmorHandler.createArmorGroup("armed_skeleton", 0.4);

group.addEntity(<entity:minecraft:skeleton>);

group.addArmor(ArmorHandler.createArmorSlot("mainhand", <minecraft:bow>));

group.addArmor(ArmorHandler.createArmorSlot("offhand", <minecraft:shield>));

`

Combine With Armor

Weapon slots and armor slots live in the same group, so you can build a full loadout in one place. Add head, chest, legs, and feet slots alongside the mainhand and offhand entries. The mod applies every slot you register, so a skeleton can spawn fully armored and holding a bow.

Things to Watch

Not every entity supports every slot. A mob without an offhand inventory will simply ignore that entry, so test in-game rather than assuming. If you want a weapon to appear only sometimes, put it in its own group with a lower chance instead of bundling it with the armor group. Reload with /ct reload after each edit and spawn the entity to verify the item lands in the correct hand.