Jump to content

[1.16.5] Custom commands with optional arguments.


Recommended Posts

Recently I've been making a few custom commands for a mod I'm working on, and although making custom commands is easy enough, making them have optional arguments (E.g. Who to target being defaulted to @p) is quite a pain as it requires method overloading (from what I've been doing anyway) causing a lot of duplicated code.

Is there a better method to make optional arguments with default values without method overloading and or excessive amounts of code duplication?

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.

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.

  • Create New...

Important Information

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