#✅ | A text to appear that a user can copy to clipboard

1 messages · Page 1 of 1 (latest)

vast epoch
#

Is it possible to have something that lets users copy text to clipboard? My modpack uses a security key that defines and verifies a user's access to my server as well as their connection to my discord server. This security key is unique but is quite a hassle to distribute as I can't just post it in a public space. Instead, I want the key to show up in game instead along with my modpack using a fancy menu layout if that is possible. Only people downloading the modpack with the intention of joining can see it anyways.

wild tigerBOT
#

Hi! Please first select which type of question you want to ask:

  • "Normal Question" is enough for most questions. If you are unsure, you should choose this mode. It provides quick and accurate answers to your questions and problems.
  • "Complex Task" is for very complex questions and multi-step tasks. For example, questions involving complex action script, requirement, or placeholder logic. Normal users will almost never need this. Getting answers takes much longer here.

It is not possible for anybody to send messages in this thread before selecting a mode.

Selected mode: 💬 Normal Question

wild tigerBOT
# vast epoch Is it possible to have something that lets users copy text to clipboard? My modp...

Yep, FancyMenu can do that 👍

The built-in way is the action called Copy Text to Clipboard (copytoclipboard) from the action script system.

The cleanest setup is usually:

  1. Add a Text element to show the key
  2. Add a Button next to it labeled something like “Copy Key”
  3. Give the button an action script with:
    • Action: Copy Text to Clipboard
    • Value: your key text

If the key is stored in a FancyMenu variable, you can copy that instead with a placeholder like:

{"placeholder":"getvariable","values":{"name":"security_key"}}

So you can make the button copy the variable value rather than hardcoding the key.

If you want the text itself to be clickable, you can also use a Markdown click event in a Text element and react to it with the On Markdown Text Clicked listener, then run the same copytoclipboard action there.

One important note though: if this key is truly sensitive, putting it into a client-side modpack means players can still inspect it from their files. So this is great for convenience, but not for keeping a secret secure 🔐

If you want, I can show you a tiny example layout setup for this, either with a button or with clickable text 🙂

#
Thread Marked as Solved

This support thread has been marked as solved by @vast epoch.

The AI helper is now disabled.

#

✅ | A text to appear that a user can copy to clipboard