Messing with Mob Equipment in Vanilla

Messing with Mob Equipment in Vanilla - Vintage plastic bobbin with unrolled film for cinematography industry placed on black background

I'm wondering if anyone knows of a way to equip a mob with an item that already exists using vanilla minecraft 1.8 commands. Specifically, if an Item entity is on the ground, is there a way to put that into an Equipment slot on a mob?

This would be infinitely useful, as I'm trying to find a way to add enchantments and attributes while a mob is wearing the item, or at least place a an item with a large number of possible combination of enchantments on a mob.

To be absolutely clear, I'm aware of the /replaceitem command, which is the closest thing I could find to what I'm looking for in order to accomplish what I want. The {Equipment:[{},{},{},{},{}]} NBT tag doesn't allow you to access 1 slot without changing the rest of the items, which doesn't work for what I'm trying to do.



Best Answer

To make a mob able to pick up gear:

/entitydata @e[name=ENTITYNAME] {CanPickUpLoot:1b}

If the mob already has something in the slot you want to fill, use /replaceitem to get rid of it:

/replaceitem entity @e[name=ENTITYNAME] slot.armor.head air

Then teleport the item to the mob:

/tp @e[type=Item] @e[name=ENTITYNAME]

You'll probably want to put more arguments into the item selector to only select the item you want.




Pictures about "Messing with Mob Equipment in Vanilla"

Messing with Mob Equipment in Vanilla - Bobbin on heap of film
Messing with Mob Equipment in Vanilla - From above of spatulas of different forms and sizes covered with spots of dye on dirty floor in daytime
Messing with Mob Equipment in Vanilla - From above freshly brewed coffee pouring into cup placed on messy table with old photo camera and films





Mob Equipment Editor in Vanilla [EGYSZERÜ DE NAGYS




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Dmitry Demidov, Dmitry Demidov, Ksenia Chernaya, Rachel Claire