Cloaking by luk3yx

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

NOTE: The screenshot is for demonstration purposes only, there are no semi-transparent players/objects in this mod, as cloaked players are fully transparent.

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

If it crashes, it is either caused by a mod not liking non-existent players running around, or by a bug in cloaking itself.

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.

How do I use the API?

Cloaking adds the following functions:

Any above functions requiring "player" as a parameter also accept a player name, provided the player is online.

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.