Skip to content

Custom block added to registry on Client but not Server #1095

@spaceship1984

Description

@spaceship1984

Minecraft Version

1.20.1

KubeJS Version

2001.6.5-build.16

Rhino Version

2001.2.3-build.10

Architectury Version

9.2.14-fabric

Forge/Fabric Version

Fabric 0.92.6

Describe your issue

I have a startup script that works perfectly on the client and local worlds, but it causes a server to hang. This script adds a custom block to the block registry, and I've investigated the issue by pairing down the script and found that even the simplest example of adding a custom block from the KubeJS wiki causes the same issue on the server. That example being:
StartupEvents.registry('block', event => { event.create('example_block') })
I have removed all mods from the server and am only running the fabric API, Rhino, and Architectury. The server is hosted on Mordinth. The log is attached here: latest.log The error message I believe is most relevant reads:

Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.class_2248.method_8389()" because the return value of "dev.latvian.mods.kubejs.block.BlockBuilder.get()" is null

I believe this points to the registry not having been successfully updated despite the startup script running and KubeJS reporting no errors and no warnings. Is this a known bug for KubeJS on servers? I haven't been able to identify any means of working around this and would appreciate help. Thanks!

Crash report/logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions