festino-mc-plugins / ClickableLinks

Return clickable links to minecraft chat
MIT License
1 stars 0 forks source link

feature request: clickable commands #3

Closed GitNether closed 6 months ago

GitNether commented 8 months ago

Another idea I had, which would probably be fairly easy to add since you already have the structure going on:

If there is a command in the message such as ./cmd or /cmd, you could make that clickable aswell to execute the command directly. Arguments could be added using smth like /cmd%arg1%arg2 to prevent it to interfere with the sentence (just as an idea I had, need some sort of spacing indicator).

festino commented 8 months ago

Some thoughts. Open to discussion. 1. The command will not execute on click, but will be copied to the input (can be configurable)

  1. I would remove "." before the command, only if it is the first character of the message. I.e. do not remove if text ./cmd

About the arguments logic: new syntax is surely unavoidable, escaping is undesirable.

  1. I am sure commands without arguments should be clickable. E.g. use /cmd or ./cmd
  2. I would rather text ,,/cmd arg1 arg2,, text than text /cmd%arg1%arg2 (,, or % will be customizable) Pros: any text can be copied (or only commands, will be customizable) Cons: there is a risk of accidental triggering (but not if only commands) In theory, the plugin could support both syntaxes, but this seems overkill.
festino commented 6 months ago

New release: https://github.com/festino-mc-plugins/ClickableLinks/releases/tag/v2.0.0 Check if this fixed the issues or if any new ones appeared. And try out the new functionality. :)

I also discovered that I forgot to add some of the configurations promised here.

GitNether commented 6 months ago

Awesome, I love the changes! I fiddled around with it a bit and everything worked fine. Thanks for turning my suggestions into reality! ^^

GitNether commented 6 months ago

Actually, I did find one problem after all- Our custom HoverStats are gone after your plugin "re-formats" the message

festino commented 6 months ago

Glad to hear you like the update. :> I'm also curious if that funny bug was accidentally fixed.

You may create a new issue, I will try to fix them all (someday :D). This issue will be closed when I implement more configuration (copy or run command, trigger copyable text only on commands). Probably tomorrow.