LootJS: KubeJS Addon

LootJS: KubeJS Addon

19M Downloads

Add an option to prevent console swipe

SanQianQVQ opened this issue · 4 comments

commented

Describe the feature/addition!

Add an option to prevent Lootjs from outputting specific information in the console

Image

Why would like to see this feature/addition?

Due to the fact that some modules may have their loot tables set up incorrectly, this will cause Lootjs to continually output messages on the console at a high frequency, interfering with other normal messages being read:
LootJS: LootTable.Builder.build() called without setting loot table id. This may be a bug in a mod that adds loot tables. Please report it to the mod author.

commented

Which Version? Which Modloader? Any code you are using?

commented

Which Version? Which Modloader? Any code you are using?哪个版本?哪个 Modloader?你用的是哪个代码?

Sorry I forgot to include this necessary information when I created the issue.

I am using lootjs-fabric-1.20.1-2.13.0 on fabric 1.20.1 (fabric-api-0.92.2).

Here's the code I'm using:

LootJS.modifiers((event) => {
event.addLootTableModifier("deeperdarker:chests/ancient_temple_secret").removeLoot("deeperdarker:warden_upgrade_smithing_template");
event.addLootTableModifier("minecraft:chests/ancient_city").removeLoot("deeperdarker:warden_upgrade_smithing_template");
event.addLootTableModifier("minecraft:chests/bastion_treasure").removeLoot("minecraft:netherite_upgrade_smithing_template");
event.addLootTableModifier("minecraft:chests/bastion_bridge").removeLoot("minecraft:netherite_upgrade_smithing_template");
event.addLootTableModifier("minecraft:chests/bastion_other").removeLoot("minecraft:netherite_upgrade_smithing_template");
event.addLootTableModifier("minecraft:chests/bastion_hoglin_stable").removeLoot("minecraft:netherite_upgrade_smithing_template");
event.addLootTableModifier("minecraft:chests/jungle_temple").removeLoot("lostrelics:cursed_amulet");
event.addLootTableModifier("minecraft:chests/jungle_temple").randomChance(0.01).addLoot("lostrelics:cursed_amulet");
event.addLootTableModifier("minecraft:chests/jungle_temple").removeLoot("lostrelics:triple_toothed_snake");
event.addLootTableModifier("minecraft:chests/jungle_temple").randomChance(0.08).addLoot("lostrelics:triple_toothed_snake");
event.addEntityLootModifier("minecraft:piglin_brute").randomChance(0.35).addLoot("is_minecraft:obsidian_upgrade_smithing_template"); 
event.addEntityLootModifier("aquamirae:captain_cornelia").randomChance(0.90).addLoot("is_minecraft:obsidian_upgrade_smithing_template","2");
event.addEntityLootModifier("minecraft:wither").randomChance(0.50).addLoot("is_minecraft:obsidian_upgrade_smithing_template");
event.addLootTableModifier("minecraft:chests/bastion_bridge").randomChance(0.55).addLoot("is_minecraft:obsidian_upgrade_smithing_template");
event.addLootTableModifier("minecraft:chests/bastion_other").randomChance(0.55).addLoot("is_minecraft:obsidian_upgrade_smithing_template");
event.addLootTableModifier("minecraft:chests/bastion_hoglin_stable").randomChance(0.75).addLoot("is_minecraft:obsidian_upgrade_smithing_template");
event.addLootTableModifier("minecraft:chests/bastion_treasure").randomChance(1.0).addLoot("is_minecraft:obsidian_upgrade_smithing_template");
event.addLootTableModifier("minecraft:gameplay/piglin_bartering").randomChance(0.05).addLoot("is_minecraft:obsidian_upgrade_smithing_template");
event.addEntityLootModifier("minecraft:wither").removeLoot("minecraft:nether_star");
event.addEntityLootModifier("minecraft:wither").randomChance(0.75).killedByPlayer().addLoot("minecraft:nether_star");
event.addEntityLootModifier("minecraft:wither_skeleton").removeLoot("minecraft:wither_skeleton_skull");
event.addEntityLootModifier("minecraft:wither_skeleton").randomChance(0.25).killedByPlayer().addLoot("minecraft:wither_skeleton_skull");
event.addEntityLootModifier("minecraft:vindicator").removeLoot("minecraft:emerald");
event.addEntityLootModifier("minecraft:evoker").removeLoot("minecraft:emerald");
event.addEntityLootModifier("minecraft:zombie").randomChance(0.10).addLoot("doggytalents:soy_beans");
});
commented

Hey,

as in fabric lootjs injects the table id into the loot table and it looks like some mods causing problems here e. g creating a loot table outside of the loot table initialize process. But as this is 1.20 and not really a bug I won't handle that here sorry.

commented

I know it's not a bug and that other modules are causing the problem, but trying to investigate which module is using lootjs incorrectly is a difficult task, so adding a switch to turn off lootjs outputting this message is possible? Or is it not planned because of 1.20