You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My fix for it was to change the equipped attribute to system.equipped. So for instance, I have a much more specific macro to simulate/cast shield of faith on myself. Hopefully this helps:
const itemName = 'FaithShield'; // <--- Change this to the *exact* item name (capitals count!)
const regShieldname = 'Shield';
if (!actor) {
ui.notifications.warn('You need to select a token before using this macro!');
} else {
// Get both items
const myItem = await actor.items.getName(itemName);
const regShield = actor.items.getName(regShieldname);
if (myItem) {
let item = actor.items.get(myItem.id);
let regShieldItem = actor.items.get(regShield.id);
let equipped = regShieldItem.system.equipped;
// Cast "Shield of Faith"
if (equipped) {
const result = await dnd5e.documents.macro.rollItem("Shield of Faith");
}
await regShieldItem.update({ ["system.equipped"]: !equipped});
await item.update({ ["system.equipped"]: equipped});
} else {
ui.notifications.warn("No item named '" + itemName + "' found on character!");
}
}
seems like the newer version of 5e has broken this somehow.
The text was updated successfully, but these errors were encountered: