TransWikia.com

Prevent functions from showing in autofill command window

Arqade Asked by DuckyMoDuckyMoMo on June 20, 2021

With the new datapacks features and ability to easily add multiple datapacks, the autofill window can become very cluttered with function names – especially including functions that are not meant to be invoked directly (called by tick-loop, adventures, other functions, signs, etc.)

For debugging/development/user interface reasons, I would prefer to have a way to have some functions be hidden from autofill, so that they cannot be called directly, perhaps even a way to have completely disabled as executable from the command prompt.

Is there a way to do this? From my google attempts some servers have tools to limit certain commands and player abilities overall, but I just don’t want to have certain functions displayed by autofill or as an extension don’t want certain functions to be executable or viewable at all in game – through chat or command blocks. I can’t imagine that this is a unique concern or annoyance. My Autofill chat is incredibly cluttered until I really narrow-down on keying the function name with a very large number of functions that aren’t ever meant to be called directly by chat.

A naming convention or separate extension could really help with this. For example by giving them a .mcprivate extension or starting the file names with z_ or designating /sub/ as a generic folder name for hidden functions.

2 Answers

This is not possible. Autocomplete always shows all options (except where there are nearly infinitely many, like in a scoreboard name) and functions don't have a permission system by themselves.

The best you can do is to put all functions that users should execute into one namespace and all automatically called functions into another, that way you can enter /function run: and autocomplete from there.

Correct answer by Fabian Röling on June 20, 2021

I think this is possible. I know this is very old, but I haven't found any other threads on this topic. I've been making a function pack for a custom minigame/gamemode, and the startGame function does not appear in the autofill. I'm not really sure why it does this, but it's shows it's possible. With autofill Without autofill

I just looked further into it, and there are a number of functions that are not in the autofill window. The thing all these have in common are my comments; by typing //. This does not invalidate the code, as actual comments use #, but using // hides the function from autofill; it can still be called, but cannot be seen.

Answered by rawsome1234 on June 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP