Add literal and tuple types + improve struct and list default

This commit is contained in:
Misode
2024-10-24 03:31:34 +02:00
parent 039910e43e
commit e9f16aa3f7
2 changed files with 141 additions and 22 deletions

View File

@@ -386,6 +386,9 @@ const LootFunctions: Record<string, (params: any) => LootFunction> = {
item.set('written_book_content', newContent)
},
set_components: ({ components }) => (item) => {
if (typeof components !== 'object' || components === null) {
return
}
for (const [key, value] of Object.entries(components)) {
item.set(key, jsonToNbt(value))
}