Cam app - gnembon/fabric-carpet GitHub Wiki

Since Carpet 1.4 release for 1.16, the command to switch between spectator and survival mode (commandCameraMode, aka /s and /c) has been removed in favour[1] of the vanilla gamemode switcher and a Scarpet app (by gnembon). The app is called cam.sc, and once loaded, you can just type /cam to toggle between gamemodes. If "cam" is too long for you, just rename the file to whatever command you want. Maybe /c, like the old command?

Quick install

Download the app by running the command /script download survival/cam.sc to automatically download the script from the app store to your world. If you then want to customize the app as described below, go into .minecraft/saves/[worldname]/scripts/ and open cam.scwith any text editor of your liking.

Customizing

The main advantage of the Scarpet script over the old carpet rule is that the app is fully customizable. By default, it functions as a "fair camera mode", meaning it can't be used to escape death or danger. However, it can be customized to suit your needs: you can remove checks or add your own! Find them below:

Feature Description How to disable
Survival Timeout The time it will make the player wait before changing their gamemode to spectator. It's 3 seconds by default In line 8, set global_survival_timeout=0 (or any other number if you want a different timeout)
On Ground Check Makes sure that the player is on the ground (not falling) before changing their gamemode Comment (add // at the begining) or remove line 13
Air check Makes sure that the player isn't underwater, drowning or suffocating before changing their gamemode Comment or remove line 14 (you can also change the minimum air needed, 300 is all bubbles)
Burning check Makes sure that the player isn't burning before changing their gamemode Comment or remove line 15
Restore location Returns the player to the location where they got into spectator when going back to survival See below for a detailed explanation

Another of the main features of this app is that the player is placed back at its original location (also preserving motion, angles and potion effects!) when switching back to survival. That feature is not intended to be disabled, but you can do so by commenting or removing lines 126 and 128 (this way you will still preserve the potion effects you had). Doing this, you can use camera mode to travel, if for some reason you want that old & cheaty behaviour. Note that those line numbers may change in the future, this was written for this version.

Once you've configured the app the way you like it, save it in your world, and (re)load the app with /script load cam. Now you're good to go!

For a more detailed guide on how to install Scarpet apps, you can follow this one.

Liking the cam app? You can find other cool apps in the Scarpet repo, check them out!

Do you want to contribute to the cam app? You can, it's open source! Feel free to make a PR to the Scarpet repo to suggest your code to it! If you do so, please also edit the line numbers in this page so people don't get lost!