Retrieving Players in the Room:

The method room.players.get() is used to retrieve information about players currently in the room. It does not require any parameters.

// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
  if (message === "players") {
    bot.room.players.get().then(players => {
      console.log("Players in the room: ", players);
    }).catch(e => { console.error(e) });
  }
});

The output is an array of arrays, where each inner array contains information about a player and their position in the room. Each inner array consists of two elements: the first element is an object containing the player's ID and username, and the second element is an object containing the player's position coordinates (x, y, z) and facing direction.

In the provided output, each inner array represents a player in the room along with their respective position details.


Example output:

[
  [
    { id: '55bb64735531104341039ca8', username: 'iHsein' },       
    { x: 3.5, y: 0, z: 2, facing: 'FrontRight' }
  ],
  [
    { id: '62cd82da462f6b0d3c1a9c45', username: 'lunarkissez' },  
    { x: 5.5, y: 0, z: 3, facing: 'BackLeft' }
  ],
]

Sub-Methods:

Retrieving Username:

The username(userId) method retrieves the username of the specified user ID.

// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
  if (message === "username") {
    bot.room.players.username(user.id).then(username => {
      console.log(`The username of the user "${user.id}" is: ${username}`);
    }).catch(e => { console.error(e) });
  }
});


Retrieving Position:

The position(userId) method retrieves the position of the specified user ID.

// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
  if (message === "position") {
    bot.room.players.position(user.id).then(position => {
      console.log(`The position of the user "${user.id}" is: ${position}`);
    }).catch(e => { console.error(e) });
  }
});


Retrieving User ID: