Testfor specific held item with a certain name and lore?

Testfor specific held item with a certain name and lore? - Hand Holding Fishing Baits

I am trying to test if the player is holding a piece of paper named "Ticket" with a lorestring saying that the ticket is not punched. I have the following:

/testfor @p[r=10] {SelectedItemSlot:0,Inventory:[{Slot:0b,tag:{display:{Name:"Ticket",Lore:[This is a punched ticket.]}}]}

I can get it to work with just the Name but I can't get it to work with both the name and lore. How do I fix this?






Pictures about "Testfor specific held item with a certain name and lore?"

Testfor specific held item with a certain name and lore? - Free stock photo of access, business, communication
Testfor specific held item with a certain name and lore? - Free stock photo of business, composition, computer
Testfor specific held item with a certain name and lore? - Free stock photo of accessory, color, crosshatch





Check Player Inventories for 'Named' Items *Kind Of* / Buff Players Who Have Certain Items!




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

Images: Karolina Grabowska, Ruslan Khmelevsky, Ruslan Khmelevsky, Ruslan Khmelevsky