> [!column|flex no-title] >> [!menu-dark-red|ttl-c] [[Obsidian TTRPG Tutorials]] / [[Plugin Tutorials]] / [[Dataview]] / [[Dataview - List Monsters from Fantasy Statblocks Plugin]] > [!column|4 no-title] >> [!menu-green-1|ttl-c] [[Getting Started]] > >> [!menu-green-2|ttl-c] [[Plugin Tutorials]] > >> [!menu-green-3|ttl-c] [[Community Supported Games]] > >> [!menu-green-4|ttl-c] [[Obsidian TTRPG Tutorials/Templates/Templates\|Templates]] > [!column|3 no-title] >> [!patreon|ttl-c] [Patreon](https://www.patreon.com/JPlunkett) ([Starter Vault](https://www.patreon.com/posts/obsidian-patreon-96801399)) > >> [!discord|ttl-c] [Obsidian TTRPG Community Discord](https://discord.gg/CdM9UCJdwU) > >> [!discord|ttl-c] [Obsidian Official Discord](https://discord.gg/8AF29UBUCa) ## List The Monsters Form Fantasy Statblocks This example can be placed in a note and will automatically generate a list of monsters from the Fantasy Statblocks plugin. The monsters are stored in: `YourVaultFolder\.obsidian\plugins\obsidian-5e-statblocks\data.json` ```` ```dataviewjs // change this to your desired substring (case-insensitive) const nameFilter = "Goblin"; const monstersAsDvArray = dv .array(Array.from(FantasyStatblocks.getBestiary().values())) // only those with a CR .filter(m => m.cr) // only CR = '1' .where(m => m.cr == '1') // only names containing our filter term .filter(m => m.name && m.name.toLowerCase().includes(nameFilter.toLowerCase()) ); // cap at 20 entries const limitedMonsters = monstersAsDvArray.slice(0, 20); dv.table( ["Name", "HP", "AC", "CR", "Source"], limitedMonsters.map(monster => [ dv.fileLink(monster.name), monster.hp, monster.ac, monster.cr, monster.source ]) ); ``` ```` The returned table should look something like this. ![[Pasted image 20230807170134.png]] This requires the installation of the TTRPG Statblocks plugin, the Dataview plugin and you need to enable the javascript option within the Dataview settings.