Jump to content

[1.13.2] How to register commands for singleplayer?


WolfHybrid23

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.