#✅ | Is it possible to use datapacks to set FM variables?

1 messages · Page 1 of 1 (latest)

plain bluff
#

I originally had the datapack use scoreboard tags, but since those don't work, can I use it to set FM variables instead?

tender falconBOT
#

Checking the FancyMenu docs for the variable command now 🙂

tender falconBOT
# plain bluff I originally had the datapack use scoreboard tags, but since those don't work, c...

Yep, that’s possible 🙂 FancyMenu can be controlled from a datapack by calling the fmvariable command inside a function, so that’s the supported way instead of scoreboard tags.

Example in a datapack .mcfunction file:

fmvariable set my_variable hello true

A couple of small notes:

  • In a function, use the command without the leading /.
  • If you need it to affect a specific player, run it as that player, e.g.:
    execute as @p run fmvariable set my_variable hello true
    
  • In multiplayer, FancyMenu needs to be installed on the server side for server-run commands like this to work.

So short version: yes, use /fmvariable via datapack functions, not scoreboard tags. If you want, I can also help you write the exact function for your setup 🛠️

plain bluff
#

Can I prevent players from changing it manually?

tender falconBOT
#

Checking whether FancyMenu has any built-in way to lock variables from manual editing 🔍

#

Looks like there isn’t a hard lock for variables, so I’m checking the docs for the safest workaround now 🙂

tender falconBOT
# plain bluff Can I prevent players from changing it manually?

Not completely, no 😅

FancyMenu doesn’t really have a true “read-only variable” lock. The best you can do is:

  • Hide/disable the FancyMenu UI stuff with modpack mode, so players can’t easily open the variable editor from the menu bar or hotkeys.
  • On a server, don’t give them OP/command access, because /fmvariable is command-based.
  • In singleplayer, you can’t fully prevent the local player from changing it, since they control the instance.

So the practical answer is: you can make it inconvenient, but not 100% impossible for a determined player.

If you want, I can help you set it up in the most secure way for either:

  • singleplayer/modpack use, or
  • multiplayer/server use 🎮