Client commands - dispatcher is null #2489
-
I can't find the exact stack trace, not at my PC currently. However, as part of my mod I would like to register some client-side commands. Past mods I've made have used v1 of the client command API, however since then the API seems to have moved to v2, which has a slightly different syntax. To cut a long story short, this means I cannot register commands unless there is an active connection to a server. If there isn't, How should I go about registering client-side only commands? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Use the |
Beta Was this translation helpful? Give feedback.
Use the
ClientCommandRegistrationCallback.EVENT
event to handle client command registration. The handler will be passed a non-null instance ofCommandDispatcher<FabricClientCommandSource>
.