mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 07:10:41 +00:00
Fix #640 handle malformed set_enchantments in loot table preview
This commit is contained in:
@@ -432,6 +432,9 @@ const LootFunctions: Record<string, (params: any) => 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())
|
||||
|
||||
Reference in New Issue
Block a user