diff --git a/src/app/components/previews/LootTable.ts b/src/app/components/previews/LootTable.ts index 9cdcbb5c..d1c3e909 100644 --- a/src/app/components/previews/LootTable.ts +++ b/src/app/components/previews/LootTable.ts @@ -432,6 +432,9 @@ const LootFunctions: Record LootFunction> = { } }, set_enchantments: ({ enchantments, add }) => (item, ctx) => { + if (typeof enchantments !== 'object' || enchantments === null) { + return + } if (item.is('book')) { item.id = Identifier.create('enchanted_book') item.base = ctx.getBaseComponents(item.id.toString())