In the 14w02c Snapshot, I was able to use this command to test for am Item Frame with a Book & Quill inside:
/testfor @e[type=ItemFrame] {Item:{id:386s,Count:1b,Damage:0s}}
However, in the 14w03a/14w03b Snapshots, I was unable to do so using a numerical or string identifier. I'm not sure if I'm just making a mistake in the command, but I tried this command (as well as a few other variants with minor tweaks):
/testfor @e[type=ItemFrame,r=4] {Item:{id:writable_book,Count:1b,Damage:0s}}
Steps to reproduce:
1.Place a Command Block and paste either of the above commands.
2.Put an Item Frame anywhere.
3.Place Book and Quill (or desired item), in said Item Frame.
4.Activate the Command Block.
5. In the "Previous Output" part, it should come up with an error message similar to this:
"entity.ItemFrame.name did not match the required data structure"
Even though the criteria should be met, it doesn't seem to work.
I would appreciate it if I could get any help on this matter, thank you! 🙂
Comments 6
You need to label the modpack, in which case is "minecraft":
/testfor @e[type=ItemFrame,r=4] {Item:{id:minecraft:writable_book,Count:1b,Damage:0s}}
You also are not required to include the Count or Damage but I have left them in there in case they were intended.
That is for the root syntax for commands such as /give; it is required when accessing pre-existing NBT tags in dataTags. The game saves the items with "minecraft:" as the suffix to all items, while the /give command will apply it as the default if you don't.
Confirmed.