Welcome to the community.
This can be a bit more involved than first thought. As Kaldor has already pointed out, such items could be picked up by companions that the player may eventually have leave the party. Furthermore, it’s possible you may want to pass a “plot” item to another PC for some reason, or to an NPC, or even place into a container.
Personally, I do what Shallina mentioned, and script it so that items whose tags start with a certain phrase are checked via onacquire and unacquire events. That way, each such item can retain all other normal “properties” and can then only be transferred or dropped as you require (checked in your scripts).
Bear in mind that you would still need to check if a player drops a PC from the party (that may be carrying the item), and ensure it ends up on the Main PC. However, if you have set aside a basic tag style for such items, you can iterate through their items and pass it off when that PC is dropped.
If you want to avoid “item check” completely and don’t mind what may appear some odd logical flow, you can simply rely on variables (even just journal entries) to keep track of “items” the party may have had. As an example: The party require the “ogre head” item that you wish to check for quest completion. You could, in theory, just update the journal when they pick up the head and assume the head is always carried at that point onwards. That way, if they happen to lose the head, it won’t matter, as the journal is keeping track of the quest state. As I say, it may offend ones sense of logical flow, but it does help avoid that problem.
The hardest issue you would need to overcome is when you are tracking multiple items over multiple PCs, in an item collection type quest. Just imagine a quest where the PCs are collecting ten bottles, and the player has each PC pick one up. Do you allow a PC to pass one to another to keep the stack in one place? Do these items even stack? Then, also bear in mind if this is going to be a MP game. What happens when different players pick up multiple items of a multi item collection quest?
The bottom line is, you need to consider if your quest item is just a single item or not, and if not, is it stackable? Is this just for a SP or a MP campaign? How much do you want the item’s presence (or not) appear logical to the quest?
Possible Simplest Solution: Without knowing what you have fully in mind here (bar the direct question), the answer you may need may be something as simply as keeping the quest updated using just a story variable. Quest Update: “You stow the giant’s head in the party secret bag ready to return to the king.” ← that way, the player knows they have the item, and secondly, you don’t have to manage it any further.