Jump to content

[1.16.5] Custom Tag doesn't Work (ResourceLocation is null)


Recommended Posts

Posted (edited)

I created a tag as described in the forge doc,

when I try to check whether a block is included in this tag, I get an error

this is my tag

this is my Tag Class

and that's the block class  in which I use the tag

 

and that's the error i get:

[16:05:47] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:130]: ---- Minecraft Crash Report ----
// Surprise! Haha. Well, this is awkward.

Time: 09.03.21, 16:05
Description: Unexpected error

java.lang.NullPointerException: Cannot invoke "net.minecraft.tags.ITag.contains(Object)" because the return value of "net.minecraft.tags.ITagCollection.get(net.minecraft.util.ResourceLocation)" is null
	at net.luis.industry.api.blocks.PipeBlock.updatePostPlacement(PipeBlock.java:79) ~[main/:?] {re:classloading}
	at net.minecraft.block.AbstractBlock$AbstractBlockState.updatePostPlacement(AbstractBlock.java:749) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading}
	at net.minecraft.block.AbstractBlock$AbstractBlockState.updateNeighbours(AbstractBlock.java:684) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading}
	at net.minecraft.world.World.markAndNotifyBlock(World.java:274) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.World.setBlockState(World.java:241) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.World.setBlockState(World.java:205) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraftforge.common.extensions.IForgeBlock.removedByPlayer(IForgeBlock.java:200) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading}
	at net.minecraftforge.common.extensions.IForgeBlockState.removedByPlayer(IForgeBlockState.java:157) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading}
	at net.minecraft.client.multiplayer.PlayerController.onPlayerDestroyBlock(PlayerController.java:118) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.multiplayer.PlayerController.clickBlock(PlayerController.java:143) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1349) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:1688) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1507) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:979) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-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.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
	at net.luis.industry.api.blocks.PipeBlock.updatePostPlacement(PipeBlock.java:79) ~[?:?] {re:classloading}
	at net.minecraft.block.AbstractBlock$AbstractBlockState.updatePostPlacement(AbstractBlock.java:749) ~[forge:?] {re:classloading}
	at net.minecraft.block.AbstractBlock$AbstractBlockState.updateNeighbours(AbstractBlock.java:684) ~[forge:?] {re:classloading}
	at net.minecraft.world.World.markAndNotifyBlock(World.java:274) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.World.setBlockState(World.java:241) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.World.setBlockState(World.java:205) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraftforge.common.extensions.IForgeBlock.removedByPlayer(IForgeBlock.java:200) ~[forge:?] {re:classloading}
	at net.minecraftforge.common.extensions.IForgeBlockState.removedByPlayer(IForgeBlockState.java:157) ~[forge:?] {re:classloading}
	at net.minecraft.client.multiplayer.PlayerController.onPlayerDestroyBlock(PlayerController.java:118) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.multiplayer.PlayerController.clickBlock(PlayerController.java:143) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1349) ~[forge:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:1688) ~[forge:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
-- Affected level --
Details:
	All players: 1 total; [ClientPlayerEntity['Dev'/233, l='ClientLevel', x=-60.09, y=67.00, z=3.87]]
	Chunk stats: Client Chunk Cache: 841, 529
	Level dimension: minecraft:overworld
	Level spawn location: World: (-48,68,18), Chunk: (at 0,4,2 in -3,1; contains blocks -48,0,16 to -33,255,31), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
	Level time: 4504 game time, 4504 day time
	Server brand: forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.world.ClientWorld.fillCrashReport(ClientWorld.java:465) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2091) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:633) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-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.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.46_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {}

 

Edited by Luis_ST
Posted

I'm not sure if it's necessary to put .json in your TagClass. But since I'm not an exepert on modding, Idk if removing it will work. So therefore, I suggest that you take a look in my Tags Class, I made it a bit different but it works.

I hope I could help you ^^

Posted
8 hours ago, Beethoven92 said:

I think you do not need to specify the whole path here

You're right, minecraft only needs the name of the file and not the complete path

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.