The setup I have is a command that will test all item frames @e[type=ItemFrame]
and if an item is placed into it, I want the item to receive an enchantment, but I want it to allow any item and use only one command. Is this an option?
1 Answer
If the enchantment is fine to be on any item, a simple /entitydata will do. Note that any enchantments that were previously on the item will be erased.
/entitydata @e[type=ItemFrame] {Item:{tag:{ench:[{id:16,lvl:1}]}}}
-
Well no it will overwrite any enchantment of the same, such as if it's 16 lvl 50 it would replace the lvl 50 but other then that this worked for me. Nov 24, 2015 at 16:28
-
@Kronogenics The entire
ench
tag is essentially deleted off of the old entity and replaced with the newench
tag. This happens because it's a list-type tag. It appears as though it only merges in this case, but that's incorrect. It's simply coincidence because you've specified the same enchantment type to replace. Nov 24, 2015 at 20:06
ItemFrame
).