The coordinates can be added as target selector arguments, i.e. inside the @e[...]
, using the x
, y
, and z
arguments, combined with r
to set a maximum radius. Note that Tilde notation is not allowed for this, you need the absolute coordinates.
Placing an enchanted item in an Item Frame has to be done all at once, since the entitydata is running on the Item Frame, not on the item that is in it. This is done by setting the Item
tag of the item frame to a valid compound NBT structure for an item, such as
{id:"minecraft:stone_sword",tag:{ench:[{id:16,lvl:1}]}}
for a Sharpness I Stone Sword.
Overall, the command you want to be running might look like:
entitydata @e[type=ItemFrame,x=1,y=2,z=3,r=2] {Item:{id:"minecraft:stone_sword",tag:{ench:[{id:16,lvl:1}]}}}
Be careful regarding the closing parentheses.
This is not possible in 1.7.10 vanilla due to the severe lack of command features, namely the @e
selector.
I would highly recommend upgrading to a more recent version. For example, in 1.8, the @e
selector was introduced in order to target non-player entities with commands, as well as the ability to add mobs to a scoreboard team. If a mob is in the same team as a player, that mob will no longer be hostile towards that player but will remain hostile towards non-teammates.
/scoreboard teams add Passive
/scoreboard teams join Passive @p @e[type=Zombie]
Best Answer
You can tag all item frames that have an item in them, then test if any don't have that tag: