Skip to content

Instantly share code, notes, and snippets.

@7H3LaughingMan
Last active December 22, 2024 02:02
Show Gist options
  • Select an option

  • Save 7H3LaughingMan/04cd267a9a8b10d4a9da0d84185414a6 to your computer and use it in GitHub Desktop.

Select an option

Save 7H3LaughingMan/04cd267a9a8b10d4a9da0d84185414a6 to your computer and use it in GitHub Desktop.
Clear Temporary Items
Hooks.on("combatTurnChange", async (encounter) => {
if (encounter.combatant.isOwner) {
encounter.combatant.actor.itemTypes.weapon
.filter((item) => item.system.temporary && item.system.quantity === 0)
.forEach((item) => item.delete());
}
});
ui.notifications.info("Created Clear Temporary Items Hook");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment