Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.16.5] [SOLVED] Couldn't parse loot modifier cosrpg:blaze_rinkril error


auriny
 Share

Recommended Posts

How to fix it?

error:

Quote

[15:03:59] [Render thread/ERROR] [ne.mi.co.lo.LootModifierManager/]: Couldn't parse loot modifier cosrpg:blaze_rinkril
java.lang.NullPointerException: null
    at net.minecraftforge.common.loot.LootModifierManager.deserializeModifier(LootModifierManager.java:139) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraftforge.common.loot.LootModifierManager.lambda$apply$0(LootModifierManager.java:115) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:1.8.0_181] {}
    at net.minecraftforge.common.loot.LootModifierManager.apply(LootModifierManager.java:113) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraftforge.common.loot.LootModifierManager.apply(LootModifierManager.java:54) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraft.client.resources.ReloadListener.lambda$reload$1(ReloadListener.java:14) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:656) ~[?:1.8.0_181] {}
    at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:632) ~[?:1.8.0_181] {}
    at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442) ~[?:1.8.0_181] {}
    at net.minecraft.resources.AsyncReloader.lambda$null$3(AsyncReloader.java:66) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraft.util.concurrent.ThreadTaskExecutor.doRunTask(ThreadTaskExecutor.java:136) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.util.concurrent.RecursiveEventLoop.doRunTask(RecursiveEventLoop.java:22) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraft.util.concurrent.ThreadTaskExecutor.pollTask(ThreadTaskExecutor.java:109) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.util.concurrent.ThreadTaskExecutor.managedBlock(ThreadTaskExecutor.java:119) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.client.Minecraft.makeServerStem(Minecraft.java:1865) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.loadWorld(Minecraft.java:1717) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.loadLevel(Minecraft.java:1683) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.screen.WorldSelectionList$Entry.loadWorld(WorldSelectionList.java:364) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.screen.WorldSelectionList$Entry.joinWorld(WorldSelectionList.java:273) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.screen.WorldSelectionList$Entry.mouseClicked(WorldSelectionList.java:225) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.widget.list.AbstractList.mouseClicked(AbstractList.java:309) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.INestedGuiEventHandler.mouseClicked(INestedGuiEventHandler.java:28) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.MouseHelper.lambda$onPress$0(MouseHelper.java:87) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:427) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.MouseHelper.onPress(MouseHelper.java:85) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.MouseHelper.lambda$null$4(MouseHelper.java:181) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(ThreadTaskExecutor.java:86) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.client.MouseHelper.lambda$setup$5(MouseHelper.java:180) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar:build 10] {}
    at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar:build 10] {}
    at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) ~[lwjgl-glfw-3.2.2.jar:build 10] {}
    at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:93) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.MainWindow.updateDisplay(MainWindow.java:306) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:997) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:607) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181] {}
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108) [forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] {}
 

 

blaze_rinkril.json:

{
  "conditions": [
    {
      "condition": "forge:loot_table_id",
      "loot_table_id": "minecraft:entities/blaze"
    }
  ],
  "addition": "cosrpg:rinkril"
}

global_loot_modifiers.json:

{
  "replace": false,
  "entries": [
    "cosrpg:blaze_rinkril"
  ]
}

how im trying to register serializer:

package com.auriny.cosrpg.events;

import com.auriny.cosrpg.CoSRPG;
import com.auriny.cosrpg.events.loot.RinkrilAdditionModifier;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.loot.GlobalLootModifierSerializer;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;

import javax.annotation.Nonnull;

public class ModEventBusEvents {
    @SubscribeEvent
    public static void registerModifierSerializers(@Nonnull final RegistryEvent.Register<GlobalLootModifierSerializer<?>>
                                                           event) {
        event.getRegistry().registerAll(
                new RinkrilAdditionModifier.Serializer().setRegistryName
                        (new ResourceLocation(CoSRPG.MOD_ID, "blaze_rinkril"))
        );
    }
}

RinkrilAdditionModifier:

package com.auriny.cosrpg.events.loot;

import com.google.gson.JsonObject;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.LootContext;
import net.minecraft.loot.conditions.ILootCondition;
import net.minecraft.util.JSONUtils;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.loot.GlobalLootModifierSerializer;
import net.minecraftforge.common.loot.LootModifier;
import net.minecraftforge.registries.ForgeRegistries;

import javax.annotation.Nonnull;
import java.util.List;
import java.util.Objects;

public class RinkrilAdditionModifier extends LootModifier {
    private Item addition;

    public RinkrilAdditionModifier(ILootCondition[] conditionsIn, Item addition) {
        super(conditionsIn);
        this.addition = addition;
    }

    protected RinkrilAdditionModifier(ILootCondition[] conditionsIn) {
        super(conditionsIn);
    }

    @Nonnull
    @Override
    protected List<ItemStack> doApply(List<ItemStack> generatedLoot, LootContext context) {
        // generatedLoot is the loot that would be dropped, if we wouldn't add or replace
        // anything!
        generatedLoot.add(new ItemStack(addition));
        return generatedLoot;
    }

    public static class Serializer extends GlobalLootModifierSerializer<RinkrilAdditionModifier> {
        @Override
        public RinkrilAdditionModifier read(ResourceLocation name, JsonObject object, ILootCondition[] conditionsIn) {
            Item addition = ForgeRegistries.ITEMS.getValue(
                    new ResourceLocation(JSONUtils.getAsString(object, "addition")));
            return new RinkrilAdditionModifier(conditionsIn, addition);
        }

        @Override
        public JsonObject write(RinkrilAdditionModifier instance) {
            JsonObject json = makeConditions(instance.conditions);
            json.addProperty("addition", Objects.requireNonNull(ForgeRegistries.ITEMS.getKey(instance.addition)).toString());
            return json;
        }
    }
}

paths: https://prnt.sc/4CdRkN5hf6Xt

it seems to me that I did everything correctly, but since it does not work, there is some kind of error. any help is welcome.

Edited by auriny
Link to comment
Share on other sites

58 minutes ago, auriny said:
ModEventBusEvents

Have you registered this class to the event bus? I would recommend using DeferredRegister.

Your loot modifier JSON file is also missing the type property to specify the registry name for the GlobalLootModifierSerializer to use. This property will be required after 1.16.5.

Link to comment
Share on other sites

Posted (edited)
1 hour ago, diesieben07 said:

Have you registered this class to the event bus? I would recommend using DeferredRegister.

Your loot modifier JSON file is also missing the type property to specify the registry name for the GlobalLootModifierSerializer to use. This property will be required after 1.16.5.

if you mean this, yes, but from the very beginning, when I made this line, it seemed to me that I did something wrong

Quote

MinecraftForge.EVENT_BUS.register(ModEventBusEvents.class);

and what should be in "type"? i didnt understood when i read this https://mcforge.readthedocs.io/en/1.16.x/items/globallootmodifiers 

Edited by auriny
Link to comment
Share on other sites

  

38 minutes ago, diesieben07 said:

RegistryEvent.Register fires on the mod event bus, not the forge bus. [eq

 

 

i.e. should I specify '"type": "cosrpg:global_loot_modifiers"'?

Link to comment
Share on other sites

 

42 minutes ago, diesieben07 said:

No, that is not the registry name for your GLM. Look at your registry event again.

oh, i understood, thanks, but i dont understood how to register this class... can you tell me, please?

Link to comment
Share on other sites

solved, problem was in serialize registry

if you need, here's code:

package com.auriny.cosrpg.events;

import com.auriny.cosrpg.CoSRPG;
import com.auriny.cosrpg.events.loot.RinkrilAdditionModifier;
import net.minecraftforge.common.loot.GlobalLootModifierSerializer;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.IForgeRegistry;

@Mod.EventBusSubscriber(modid = CoSRPG.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModEventBusEvents {

    @SubscribeEvent
    public static void registerModifierSerializers(final RegistryEvent.Register<GlobalLootModifierSerializer<?>> event) {
        IForgeRegistry<GlobalLootModifierSerializer<?>> registry = event.getRegistry();
        register(registry, new RinkrilAdditionModifier.Serializer(), "blaze_rinkril");
    }

    private static void register(IForgeRegistry<GlobalLootModifierSerializer<?>> registry, GlobalLootModifierSerializer<?> serializer, String name) {
        registry.register(serializer.setRegistryName(CoSRPG.MOD_ID, "blaze_rinkril"));
    }
}

 

Link to comment
Share on other sites

  • auriny changed the title to [1.16.5] [SOLVED] Couldn't parse loot modifier cosrpg:blaze_rinkril error

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
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.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • you need to check if the EventHandler is called
    • update Forge to the latest version 1.16.5 requires java 8
    • C:\Users\(My Name)\Desktop\Clockwise server>java -Xmx10240M -Xms10240M -jar forgeserver.jar nogui 2022-05-26 12:35:05,381 main WARN Advanced terminal features are not available in this environment [12:35:05] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmlserver, --fml.forgeVersion, 36.1.30, --fml.mcpVersion, 20210115.111550, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, nogui] [12:35:05] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 8.0.9+86+master.3cf110c starting: java version 1.8.0_333 by Oracle Corporation [12:35:06] [main/INFO] [ne.mi.fm.lo.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust [12:35:06] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.2 Source=file:/C:/Users/Joshua%20Hague/Desktop/Clockwise%20server/libraries/org/spongepowered/mixin/0.8.2/mixin-0.8.2.jar Service=ModLauncher Env=SERVER [12:35:06] [main/WARN] [ne.mi.fm.lo.FMLConfig/CORE]: Configuration file C:\Users\Joshua Hague\Desktop\Clockwise server\config\fml.toml is not correct. Correcting [12:35:06] [main/WARN] [ne.mi.fm.lo.FMLConfig/CORE]: Incorrect key [defaultConfigPath] was corrected from null to defaultconfigs [12:35:06] [main/INFO] [cp.mo.mo.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmlserver' with arguments [--gameDir, ., nogui] Exception in thread "main" [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]: java.lang.NoSuchMethodError: sun.security.util.ManifestEntryVerifier.<init>(Ljava/util/jar/Manifest;)V [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.SecureJarHandler.createCodeSource(SecureJarHandler.java:66) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:275) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:136) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at java.lang.ClassLoader.loadClass(Unknown Source) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at java.lang.Class.forName0(Native Method) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at java.lang.Class.forName(Unknown Source) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.fml.loading.FMLServerLaunchProvider.lambda$launchService$0(FMLServerLaunchProvider.java:51) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) [12:35:07] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.server.ServerMain.main(ServerMain.java:57) C:\Users\(My Name)\Desktop\Clockwise server>PAUSE Tried it again with just Java version 8 update 333, still nothing.
    • package com.zaksen.fancydecorativeblocks; import com.zaksen.fancydecorativeblocks.screen.FancyMenuTypes; import com.zaksen.fancydecorativeblocks.screen.WoodCrateScreen; import net.minecraft.client.gui.screens.MenuScreens; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; @Mod.EventBusSubscriber(modid = FancyDecorativeBlocks.MOD_ID) public class ClientSetup { @SubscribeEvent public static void clientSetup(final FMLClientSetupEvent Event) { Runnable runnable = new Runnable() { @Override public void run() { MenuScreens.register(FancyMenuTypes.WOOD_CRATE_MENU.get(), WoodCrateScreen::new); } }; Event.enqueueWork(runnable); } } I create new class for it, but how i need call it?
    • Hey thanks for the reply So I can't exactly remove mods from the modpack without causing severe problems with the world so I just tried increasing the max-tick-time and found out it happens between these lines   [26May2022 20:15:49.384] [Server thread/DEBUG] [mixin/]: Mixing MixinNetworkItemManager from creativewirelesstransmitter.mixins.json into com.refinedmods.refinedstorage.apiimpl.network.item.NetworkItemManager [26May2022 20:19:51.050] [Server thread/DEBUG] [mixin/]: Mixing MixinBlockEntityExtension from architectury.mixins.json into me.shedaniel.architectury.extensions.BlockEntityExtension Here's the full debug.log, had to shorten it a little cause it was too big for pastebin so I cut the start out, if you need it I can also send it Also because I increased the max-tick-time it didn't crash but I dont wanna keep it that way since a 4 minute tick has to have an explanation. So any idea of how to fix this?
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.