Block drops using Vanilla loot tables? #631
-
Hi, I have a question on how the loot table function for blocks is supposed to work. I have created the following server script for a new ore I want to add. using pool.addItem works, but I wanted to use the Vanilla style loot table and I thought pool.addEntry: startup script: StartupEvents.registry('block', event => {
event.create('modmonjo:lead_ore')
.material('stone')
.hardness(3)
.displayName('Lead Ore')
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:needs_stone_tool')
.requiresTool(true)
}) server script: ServerEvents.blockLootTables(event => {
event.addBlock('modmonjo:lead_ore', table => {
table.addPool(pool => {
pool.addEntry('modmonjo:lead_ore') //What i want but not working
//pool.addItem('modmonjo:raw_lead', 100, [4, 8]) //old but working
})
})
}) Looking at the Wiki (https://wiki.latvian.dev/books/kubejs-legacy/page/loot-table-modification) (outdated because of kubejs 6) is pool.addEntry what I think it does? How can i achieve using this style of loot table? Or is there a way to convert my datapack style loot table to a kubejs one? KubeJS Forge 1902.6.0-build.142 (1.19.2) Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
wow that code did not paste the way i wanted it to (im very new) Heres a pastebin |
Beta Was this translation helpful? Give feedback.
Move the loot table to
kubejs/data/modmonjo/loot_tables/blocks/lead_ore.json
.That should remove the need for the script, as this is where MC looks for the blocks loot table in the first place.
In theory it is possible to not use the json and make the entire loot table in script, but KubeJS' loot table format is difficult to work with and not very well documented.