WolfHybrid23 Posted February 17, 2019 Posted February 17, 2019 I know how to create and use commands but how do I register them for singleplayer worlds? Quote
V0idWa1k3r Posted February 17, 2019 Posted February 17, 2019 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? Quote
WolfHybrid23 Posted February 17, 2019 Author Posted February 17, 2019 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. Quote
WolfHybrid23 Posted February 17, 2019 Author Posted February 17, 2019 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". Quote
Recommended Posts
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.