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

Disconnection From Server When Placing Modded Block

Recommended Posts

I'm playing around with making my own mod. It works fine in Singleplayer but when I test it on a server my client gets disconnected with error message Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException (there is no further stack trace) when I place the Portal Base block. I can reconnect just fine, but will get disconnected again when I place another of those blocks.

I haven't found much about this specific issue. Any help would be appreciated.

Code: https://github.com/eddie1101/PortalTest/


logs: (Though they're not very helpful, is there some way to make the error more verbose? A stack trace would really help)

Server: https://pastebin.com/JN6gnQyx

Client: https://pastebin.com/AWVavatz


Thanks in advance.


Edit: Attached .jar if you want to try to reproduce


Edited by octa
Link to post
Share on other sites

Your repository is not complete, the gradle wrapper and build.gradle should be included to make it usable. The MDK comes with a properly configured .gitignore file for a reason.


Start the game with the system property forge.logging.mojang.level=debug to see the stacktrace.

Link to post
Share on other sites

Repo is fixed. How do I run my client with system properties? It works on the server but when I add it to JVM arguments in the launcher's installation settings the game crashes.

Link to post
Share on other sites

Your repository crashes for a different reason: You have two items with the same name.

Additionally, you are not registering your registry entries properly. You need to either use @ObjectHolder or DeferredRegister.

Link to post
Share on other sites

Woops. Fixed the item names.

According to the docs, RegistryEvent.Register is a valid way of registering entries, so I'll stick with that since I know it better.

The repo should build now, so back to my original question: Why when placing a Portal Base does the client get disconnected from the server?

Link to post
Share on other sites
33 minutes ago, octa said:

According to the docs, RegistryEvent.Register is a valid way of registering entries, so I'll stick with that since I know it better.

That is fine, but then you must use @ObjectHolder instead of manually assigning fields.


37 minutes ago, octa said:

Why when placing a Portal Base does the client get disconnected from the server?

It crashes because your TileEntityPortalBase creates an SUpdateTileEntityPacket with a null BlockPos.

  • Thanks 1
Link to post
Share on other sites

Oh, that makes sense. Do you have a suggested way of initializing that BlockPos? I can't think of anything other than assigning a symbolic value which gets verified before use, but that seems clumsy.

Edit: Nvm, I was trying to return some nbt data instead of the tileentity's actual position. Thanks for the help.

Edited by octa
Link to post
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.

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.

  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Hi again, I'm trying to create a custom living entity but I keep running into this issue that causes a crash due to a ticking entity. Crash: [12:31:15] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception net.minecraft.crash.ReportedException: Ticking entity at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:855) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:787) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tickServer(IntegratedServer.java:78) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:642) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:232) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282] {} Caused by: java.lang.NullPointerException at net.minecraft.entity.LivingEntity.travel(LivingEntity.java:1905) ~[forge:?] {re:classloading} at net.minecraft.entity.LivingEntity.aiStep(LivingEntity.java:2449) ~[forge:?] {re:classloading} at net.minecraft.entity.MobEntity.aiStep(MobEntity.java:488) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.AgeableEntity.aiStep(AgeableEntity.java:115) ~[forge:?] {re:classloading} at net.minecraft.entity.passive.AnimalEntity.aiStep(AnimalEntity.java:51) ~[forge:?] {re:classloading} at net.minecraft.entity.LivingEntity.tick(LivingEntity.java:2158) ~[forge:?] {re:classloading} at net.minecraft.entity.MobEntity.tick(MobEntity.java:300) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.tickNonPassenger(ServerWorld.java:611) ~[forge:?] {re:classloading} at net.minecraft.world.World.guardEntityTick(World.java:554) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:404) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:851) ~[forge:?] {re:classloading,pl:accesstransformer:B} ... 5 more AL lib: (EE) alc_cleanup: 1 device not closed  It seems to be that I have not defined an ai/brain but I have no idea how to do this. I cant seem to see any event to do this in the library.  Any help would be greatly appreciated.
    • I have solved my own issue with poking around the Build.Gradle File and quick and swift Gradle Refresh.
    • I'm having this same issue now, have you found a solution? 
    • The new server config system is amazing in that it allows servers and worlds to have different config settings than the client, but it is really confusing for a lot of users. It's difficult to imagine a time when mod devs will be able to stop re-explaining how this system works to confused users and new pack devs. Nearly every Curseforge mod page has this "where are the configs?" conversation repeatedly in its comments. One adjustment that would make it much simpler to understand, while still maintaining the new functionality. Instead of server configs generating within world folders by default, it would be better if they could generate in the defaultconfigs folder instead. The world/serverconfig folder would be used to override server configs. The server would first look in the world's server config, and if the config file isn't there, it will look in the defaultconfigs folder. I think it would be much more intuitive this way.
  • Topics

  • Who's Online (See full list)

  • Create New...

Important Information

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