Jump to content

Caused by: java.lang.IllegalStateException: Missing loottable 'minecraft:entities/allay' for 'minecraft:allay'


yusufgamer

Recommended Posts

Caused by: java.lang.IllegalStateException: Missing loottable 'minecraft:entities/allay' for 'minecraft:allay'
	at TRANSFORMER/[email protected]/net.minecraft.data.loot.EntityLootSubProvider.lambda$generate$1(EntityLootSubProvider.java:62)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at TRANSFORMER/[email protected]/net.minecraft.data.loot.EntityLootSubProvider.generate(EntityLootSubProvider.java:55)
	at TRANSFORMER/[email protected]/net.minecraft.data.loot.LootTableProvider.lambda$run$1(LootTableProvider.java:39)
	at MC-BOOTSTRAP/[email protected]/com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
	at TRANSFORMER/[email protected]/net.minecraft.data.loot.LootTableProvider.run(LootTableProvider.java:38)
	at TRANSFORMER/[email protected]/net.minecraft.data.HashCache.generateUpdate(HashCache.java:92)
	at TRANSFORMER/[email protected]/net.minecraft.data.DataGenerator.lambda$run$0(DataGenerator.java:47)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
	at TRANSFORMER/[email protected]/net.minecraft.data.DataGenerator.run(DataGenerator.java:40)
	at TRANSFORMER/[email protected]/net.minecraftforge.data.event.GatherDataEvent$DataGeneratorConfig.lambda$runAll$2(GatherDataEvent.java:110)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.api.LamdbaExceptionUtils.lambda$rethrowConsumer$0(LamdbaExceptionUtils.java:34)
	at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:647)
	at TRANSFORMER/[email protected]/net.minecraftforge.data.event.GatherDataEvent$DataGeneratorConfig.runAll(GatherDataEvent.java:106)
	at TRANSFORMER/[email protected]/net.minecraftforge.data.loading.DatagenModLoader.begin(DatagenModLoader.java:54)
	at TRANSFORMER/[email protected]/net.minecraft.data.Main.main(Main.java:93)
	... 13 more

I get this error when i try to generate my loot tables. Here is my code

public class ModBlockLootTables extends BlockLootSubProvider {
    protected ModBlockLootTables() {
        super(Set.of(), FeatureFlags.REGISTRY.allFlags());
    }

    @Override
    protected void generate() {
        // ores
        add(BlockInit.BLACK_DIAMOND_ORE.get(), createOreDrop(BlockInit.BLACK_DIAMOND_ORE.get(),
                ItemInit.BLACK_DIAMOND_SCRAP.get()));

        add(BlockInit.DEEPSLATE_BLACK_DIAMOND_ORE.get(), createOreDrop(
                BlockInit.BLACK_DIAMOND_ORE.get(), ItemInit.BLACK_DIAMOND_SCRAP.get()));

        add(BlockInit.INFINITUM_ORE.get(),
                createOreDrop(BlockInit.INFINITUM_ORE.get(), ItemInit.INFINITUM_SCRAP.get()));

        add(BlockInit.SPEED_ORE.get(),
                createOreDrop(BlockInit.SPEED_ORE.get(), ItemInit.SPEED.get()));

        add(BlockInit.DEEPSLATE_SPEED_ORE.get(),
                createOreDrop(BlockInit.DEEPSLATE_SPEED_ORE.get(), ItemInit.SPEED.get()));

        add(BlockInit.OMNITRIX_ORE.get(),
                createOreDrop(BlockInit.OMNITRIX_ORE.get(), ItemInit.RAW_OMNITRIX.get()));

        add(BlockInit.DEEPSLATE_OMNITRIX_ORE.get(),
                createOreDrop(BlockInit.DEEPSLATE_OMNITRIX_ORE.get(), ItemInit.RAW_OMNITRIX.get()));

        add(BlockInit.IMPERIUM_ORE.get(),
                createOreDrop(BlockInit.IMPERIUM_ORE.get(), ItemInit.RAW_IMPERIUM.get()));

        add(BlockInit.DEEPSLATE_IMPERIUM_ORE.get(),
                createOreDrop(BlockInit.DEEPSLATE_IMPERIUM_ORE.get(), ItemInit.RAW_IMPERIUM.get()));

        add(BlockInit.LEGENDARY_ORE.get(),
                createOreDrop(BlockInit.LEGENDARY_ORE.get(), ItemInit.RAW_LEGENDARY.get()));

        add(BlockInit.DEEPSLATE_LEGENDARY_ORE.get(), createOreDrop(
                BlockInit.DEEPSLATE_LEGENDARY_ORE.get(), ItemInit.RAW_LEGENDARY.get()));

        add(BlockInit.RUBY_ORE.get(), createOreDrop(BlockInit.RUBY_ORE.get(), ItemInit.RUBY.get()));

        add(BlockInit.DEEPSLATE_RUBY_ORE.get(),
                createOreDrop(BlockInit.DEEPSLATE_LEGENDARY_ORE.get(), ItemInit.RUBY.get()));

        // blocks
        dropSelf(BlockInit.OMNITRIX_BLOCK.get());
        dropSelf(BlockInit.FIRE_BLOCK.get());
        dropSelf(BlockInit.RUBY_BLOCK.get());
        dropSelf(BlockInit.SPEED_BLOCK.get());
        dropSelf(BlockInit.INFINITUM_BLOCK.get());
        dropSelf(BlockInit.BLACK_DIAMOND_BLOCK.get());
        dropSelf(BlockInit.LEGENDARY_BLOCK.get());
        dropSelf(BlockInit.IMPERIUM_BLOCK.get());
        dropSelf(BlockInit.FIRE_ORE.get());
        dropSelf(BlockInit.OmnitrixCrafter.get());
    }

    @Override
    protected Iterable<Block> getKnownBlocks() {
        return ForgeRegistries.BLOCKS.getValues()
            .stream()
            .filter(block -> BenTenMod.MOD_ID
                .equals(ForgeRegistries.BLOCKS.getKey(block).getNamespace()))
            .collect(Collectors.toSet());
    }
}

public class ModLootTables extends LootTableProvider {
    public ModLootTables(DataGenerator dataGeneratorIn) {
        super(dataGeneratorIn.getPackOutput(), Set.of(), ImmutableList.of(
                new SubProviderEntry(ModBlockLootTables::new, LootContextParamSets.BLOCK),
                new SubProviderEntry(ModEntityLootTables::new, LootContextParamSets.ENTITY)));
    }

    @Override
    public List<SubProviderEntry> getTables() {
        return ImmutableList.of(
                new SubProviderEntry(ModBlockLootTables::new, LootContextParamSets.BLOCK),
                new SubProviderEntry(ModEntityLootTables::new, LootContextParamSets.ENTITY));
    }

    @Override
    protected void validate(Map<ResourceLocation, LootTable> map,
            ValidationContext validationtracker) {
        map.forEach((id, table) -> LootTables.validate(validationtracker, id, table));
    }
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.