Loot Table Modifier generator (#758)
Some checks failed
Deploy to GitHub Pages / build (push) Has been cancelled
Deploy to GitHub Pages / deploy (push) Has been cancelled

* Loot Table Modifier loot_modifier generator

Should support everything currently implemented

* Translation keys

* Make 'actions' and 'predicates' always a list

Seems simpler to understand and a list of one entry behaves exactly the same

* Update loot-table-modifier.mcdoc

Should match currently latest commit

* Fix loot modifier path in datapack being incorrect

* Match v2 alpha 1

* Import LootPoolEntry

* Add files via upload

* Revert "Add files via upload"

This reverts commit 7e9c50ee10.

* add condition_add action

* Add union member name overrides

Co-authored-by: Misode <misoloo64@gmail.com>

---------

Co-authored-by: Misode <misoloo64@gmail.com>
This commit is contained in:
OffsetMonkey538
2026-01-19 22:06:31 +02:00
committed by GitHub
parent e02c26f6db
commit 1f8be81f50
4 changed files with 126 additions and 0 deletions

View File

@@ -432,6 +432,10 @@ function UnionHead({ type, optional, node, ctx }: Props<UnionType<SimplifiedMcdo
}
function formatUnionMember(type: SimplifiedMcdocTypeNoUnion, others: SimplifiedMcdocTypeNoUnion[]): string {
const memberNameAttribute = type.attributes?.find(a => a.name === 'misode_member_name')?.value
if (memberNameAttribute?.kind === 'literal' && memberNameAttribute.value.kind === 'string') {
return memberNameAttribute.value.value
}
if (type.kind === 'literal') {
return formatIdentifier(type.value.value.toString())
}