Jump to content

Couldn't parse loot modifier (1.16.5)


Alanor Miga

Recommended Posts

I'm currently modifying the Simple Dungeon loot table to allow an AKM Body from my mod to appear on the chests too, but I keep getting this error:

[main/ERROR] [net.minecraftforge.common.loot.LootModifierManager/]: Couldn't parse loot modifier moguns:akm_body_dungeon
java.lang.NullPointerException: null

These are my files (java and json)
https://paste.gg/p/anonymous/4a74e4fe437f48509fa8c5d2193301b4

And here my latest.log

https://paste.gg/p/anonymous/82401acb7fd045e781ea8538bae02323

 

Edited by Alanor Miga
Link to comment
Share on other sites

  • Alanor Miga changed the title to Couldn't parse loot modifier (1.16.5)
4 minutes ago, diesieben07 said:

You have not registered your loot modifier serializer.

Thanks for the quick reply!

Isnt this the registering process?
 

@Mod.EventBusSubscriber(modid = MoGuns.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE)
public class LootEventBusEvents {

    @SubscribeEvent
    public static void registerModifierSerializers(@Nonnull final RegistryEvent.Register<GlobalLootModifierSerializer<?>>
                                                           event) {
        event.getRegistry().registerAll(
                new AKMBodyStructureAdditionModifier.Serializer().setRegistryName
                        (new ResourceLocation(MoGuns.MOD_ID,"akm_body_dungeon"))
        );

    }
}

 

Link to comment
Share on other sites

17 minutes ago, diesieben07 said:

Show updated code. Is the event handler called?

I mean this is the whole event bus
 

package moguns.events;

import moguns.MoGuns;
import moguns.events.loot.AKMBodyStructureAdditionModifier;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.loot.GlobalLootModifierSerializer;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

import javax.annotation.Nonnull;

@Mod.EventBusSubscriber(modid = MoGuns.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE)
public class LootEventBusEvents {

    @SubscribeEvent
    public static void registerModifierSerializers(@Nonnull final RegistryEvent.Register<GlobalLootModifierSerializer<?>>
                                                           event) {
        event.getRegistry().registerAll(
                new AKMBodyStructureAdditionModifier.Serializer().setRegistryName
                        (new ResourceLocation(MoGuns.MOD_ID,"akm_body_dungeon"))
        );

    }
}

 

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.