Last active
December 22, 2024 02:02
-
-
Save 7H3LaughingMan/04cd267a9a8b10d4a9da0d84185414a6 to your computer and use it in GitHub Desktop.
Clear Temporary Items
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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