Eng:Username (block)

The Username block is a sensing block and a reporter block. It reports the username of the user viewing the project, which can be used for saving progress in a project, either with a variable encoder or cloud lists (once they are released with string-storage capabilities), as well as other purposes. If no user is signed in, this block returns the empty string.

Controversy
Originally, the Scratch Team was reluctant to add this block because it could compromise users' privacy. They started with the User ID block, which gave an anonymous but effective way of recognizing users for a specific project. However, they eventually decided to replace it with this block because it is easier for beginners to understand and was so frequently requested.

As a safety measure, all projects that sense your username have warnings attached. If one wants to be anonymous, log out before viewing the project. However, it was complained that the message was too exaggerated. Alongside, the warning appears if the backpack had a script with the username block, no matter if the project had a username block or not.

Example uses
say (join [Hi ] (username)) (Note: Cloud lists have not come out yet, so you would have to make your own cloud list.) if > then add (username) to [☁ visitors v] else say [Welcome back again!] end
 * Saying hi to the user viewing the project
 * Checking if the user has visited before, using Cloud Data

when gf clicked if <(username) = []> then//a logged off user reports a blank response say [Hi new user!] for (2) secs when gf clicked if <[admins v] contains (username)?> then//The "admins" list will likely have the project owner, all of their alternate accounts, and possibly all Scratch Team members broadcast [admin v]
 * Checking if the viewer is logged in
 * Creating a high score list
 * An "admin" list in a safe chat