mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-03 06:02:54 +00:00
Handle invalid set_lore functions
This commit is contained in:
@@ -471,6 +471,7 @@ const LootFunctions: Record<string, (params: any) => LootFunction> = {
|
||||
.set('seed', new NbtLong(typeof seed === 'number' ? BigInt(seed) : BigInt(0))))
|
||||
},
|
||||
set_lore: ({ lore }) => (item) => {
|
||||
if (!Array.isArray(lore)) return
|
||||
const lines: string[] = lore.flatMap((line: any) => line !== undefined ? [JSON.stringify(line)] : [])
|
||||
// TODO: account for mode
|
||||
item.set('lore', new NbtList(lines.map(l => new NbtString(l))))
|
||||
|
||||
Reference in New Issue
Block a user