I'm trying to write a macro in FoundryVTT v11 that will simply take an item I want from an installed compendium and put it in a character or npc's inventory.
I'm new to FoundryVTT so I'm not sure sure how to make this work. Based on this reddit post I'm supposed to call createEmbeddedDocuments on my actor and pass it an Item object.
Here is the 'Amber' item I'd like to add to a token's inventory:

This is what I have so far in my macro:
//Find all actors I have selected (i.e. I am controlling) as the DM
for (let c of canvas.tokens.controlled) {
if (c.actor.type !== 'character') {
console.log(c.actor.name, "is not a playable character");
continue;
}
//Get token
let characterToken = c.actor;
//Generate a reference to the Amber item
var item = {
_id: 'NzDxIISxSXSyQltk',
id: 'NzDxIISxSXSyQltk',
name: 'Amber',
type: 'loot'
};
//Update the token's inventory
await characterToken.createEmbeddedDocuments('Item', [item]);
}
However this gives the character a new item with Amber as its name but no other details. How is this supposed to work exactly?
Disclaimer: I couldn't decide if this should go to stackoverflow.com or here but there's already a foundry-vtt tag in this site so I'm trying here first.
