Plugin disables/breaks loot_tables from DataPack
abrossimow opened this issue ยท 4 comments
Minecraft Version
1.20.1
Mod Version
2.12.0
Describe the bug!
I have a mcfunction calling unto a custom loot_table for a random number between 1 and 5. Both are loaded into Minecraft through a data pack and run as expected without LootJS.
When installing LootJS the loot_table instead of returning 1-5 always returns 0.
{ "type": "minecraft:empty", "pools": [ { "rolls": { "type": "minecraft:uniform", "min": 1, "max": 5 }, "entries": [ { "type": "minecraft:item", "name": "minecraft:cobblestone", "functions": [ { "function": "minecraft:set_count", "count": 0 } ] } ] } ] }
The function is this:
execute as @s store result score @s randomizer run loot spawn ~ ~ ~ loot fertility_quest:random_score_5 execute as @s if score @s randomizer matches 0 run tellraw @a [{"translate": "villager.level_up.message1", "color":"gold"}] execute as @s if score @s randomizer matches 1 run tellraw @a [{"translate": "villager.level_up.message1", "color":"gold"}] execute as @s if score @s randomizer matches 2 run tellraw @a [{"translate": "villager.level_up.message2", "color":"gold"}] execute as @s if score @s randomizer matches 3 run tellraw @a [{"translate": "villager.level_up.message3", "color":"gold"}] execute as @s if score @s randomizer matches 4 run tellraw @a [{"translate": "villager.level_up.message4", "color":"gold"}] execute as @s if score @s randomizer matches 5 run tellraw @a [{"translate": "villager.level_up.message5", "color":"gold"}]
I have checked log and there is nothing relevant in there.
Crash Report
No response
Log
No response
Additions and Modifications
Yes
Additions and Modifications Description
No response
Did the issue happen in singleplayer or on a server?
Singleplayer
Hey,
how do I use your command? In a command block it throws an error.
Running loot spawn ~ ~ ~ loot fertility_quest:random_score_5 as it's own command work for me. U are using count: 0, maybe on purpose but for testing I changed it to 1 and it always drops a different value. So using an uniform for the rolls works.
You are also using minecraft:empty for the loot type which is nothing which should be used in minecraft for loot tables anyways.
I run it as part of a longer tick chain. But it should work with a command block, too. You helped me nail down the problem:
With LootJS installed setting count: 0 seems to be the issue. In vanilla this works.
Now, the problem is: if I set count: 1 then every time the loot_table is called, it will drop cobblestone. Which I do not want. Replacing this with air does not work.
Background: the loot_table here is abused to generate a random number only.
I have attached a data pack for testing. On load it will create a dummy scoreboard for the randomizer to store its data in.
Then you can call it in game with /function random_tester/random_call
Oh, and I forgot: the provided data pack has count: 1 set for the loot_table. Try setting it to 0. In vanilla I expect it still to deliver random numbers, with LootJS not so much.
I probably know why it happens. Can u join our discord and ping me, I will send u a fixed jar you can test https://discord.com/invite/ThFnwZCyYY
The official support and community server of Team Almost Reliable. | 1518 members
