Page 1 of 1

[Mod] cloaking [cloaking]

PostPosted: Tue Sep 11, 2018 19:37
by luk3yx

Minetest cloaking mod

Allows players to cloak and uncloak, inspired by Star Trek's cloaking device.

What is cloaking?

In this instance, cloaking is a way to go invisible and become undetectable by most mods (unless they explicitly want to detect cloaked players, so they can still send chat messages to them).

Why is cloaking so hacky, and where does it send the 'left the game' messages?

Cloaking sends no left the game messages, it leaves that up to the built-in left the game functions. The aim of cloaking is to trick other mods into thinking the player is not in-game, and for this it must be hacky.

Help, it crashes (or glitches)

If it crashes, it is either caused by a mod not liking non-existent players running around, or by a bug in cloaking itself. Please create an issue on the GitHub or GitLab repo with the error traceback, list of mods installed, and steps to replicate the crash.

If you recently updated to Minetest 5.0.0 and can walk through nodes, please make sure you are using the latest version of cloaking (you should use it anyway).

How do I use cloaking?

Cloaking adds a modding API and two chatcommands. Both of these require the 'cloaking' privilege to execute, however you can uncloak yourself without any privileges.

- /cloak [victim]: Cloaks yourself, alternatively an unsuspecting 'victim'.
- /uncloak [victim]: Uncloaks yourself, or a 'victim'.
- /cloak_chat <message>: Sends <message> to all online players with the cloaking privilege. You can disable cloaked chat by setting cloaking.enable_cloaked_chat to false in minetest.conf.

How do I download cloaking?

You can either run git clone, or download a zip or tar.gz file. You will need to rename the downloaded folder to cloaking (if it doesn't already have that name) for it to work properly.

How do I use the API?

Cloaking adds the following functions:

cloaking.cloak_player(player): Cloaks a player.
cloaking.uncloak_player(player): Uncloaks a player.
cloaking.get_cloaked_players(): Gets a list of cloaked player names.
cloaking.is_cloaked(player): Checks if a player is cloaked.
cloaking.hide_player(player): Hides a player without cloaking them. If/when minetest.hide_player() gets introduced, this will become an alias for that.
cloaking.unhide_player(player): Unhides a player previously hidden with cloaking.hide_player(). Cloaked chat API, this is nil if cloaked chat is disabled.
· Sends a message to cloaked chat.
· The text (-Cloaked-) that is prepended to cloaked chat messages before they are sent to players.

It also adds the following functions that ignore cloaked players and can interact with them:
cloaking.get_connected_players, cloaking.get_objects_inside_radius and cloaking.get_player_by_name.

If you have made chatcommand work with players that aren't in-game, you can add _allow_while_cloaked = true to the chatcommand definition. If you explicitly don't want your chatcommand working with cloaked players, you can add _disallow_while_cloaked = true to the definition. These modifications do not require that you add cloaking to depends.txt, as when cloaking is not loaded this parameter is simply ignored.


Cloaking is licensed under the MIT license. You can see the full license here.


Cloaking has no mandatory dependencies, however it has some optional ones (chat3 and irc), as these mods need special treatment so they can function correctly. While cloaked, you cannot opt out of IRC messages.

Re: [Mod] cloaking [cloaking]

PostPosted: Tue Sep 11, 2018 20:08
by BillyS
gr8t crashy m0d m3 lik3z it +1

Re: [Mod] cloaking [cloaking]

PostPosted: Fri Sep 21, 2018 19:27
by orwell
Is it possible to do the same the other way round: making players join that are not there actually?

Re: [Mod] cloaking [cloaking]

PostPosted: Fri Sep 21, 2018 19:29
by luk3yx
orwell wrote:Is it possible to do the same the other way round: making players join that are not there actually?

Yes, that would be possible, with a lot of work. Pipeworks does something similar to use with node breakers.

Re: [Mod] cloaking [cloaking]

PostPosted: Mon Oct 08, 2018 22:51
by luk3yx
BillyS wrote:gr8t crashy m0d m3 lik3z it +1

it iZ NoW LEzZ CraZHY, YaY!

Cloaking now works nicely with the mod profiler loaded.