Posted February 17, 20196 yr I know how to create and use commands but how do I register them for singleplayer worlds?
February 17, 20196 yr What do you mean? There is an integrated server in the singleplayer world too, any command registered will work in singleplayer just as well as in multiplayer. Please elaborate on your question. Do you need to create client-side only commands or do you wish to know how to register commands in general?
February 17, 20196 yr Author I used the FMLServerStartingEvent to register the commands like this: private void onServerStarting(final FMLServerStartingEvent e) { e.getCommandDispatcher().register(LiteralArgumentBuilder.<CommandSource>literal("celriff").then(GamemodeCreativeShortcutCommand.register()).then(GamemodeSurvivalShortcutCommand.register()).then(GamemodeSpectatorShortcutCommand.register())); } but I am not able to use these commands in a single player world.
February 17, 20196 yr Author Okay, So I see a few errors with my code and fixed them. Firstly I wasn't using a SubscribeEvent annotation and Secondly, I was trying to register all of these commands as sub-commands to "celriff".
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.