bot.players is an OBJECT that contains information about players in the game. The key to the object is always the player's ID, and the value is an object containing various properties about the player.
If a player leaves the game, the ID assigned to them will be reused for new players. This includes if a player leaves and rejoins the game. If you need a permanent ID for tracking, use player.uniqueId.
bot.me is an alias to the player object for the bot itself. If the bot's ID is, say, 3, then bot.players[3] is the same as bot.me.
Anytime you see a hook with a Player argument, it's equivalent to bot.players[player.id]. For example, in the playerJoined hook, the player argument is the player object for the new player.
bot.on('playerJoin', (player) => {
console.log(`Player ${player.name} joined with ID ${player.id}`);
});
Player PropsThese are all the things that appear on a Player.
id: string - The player's ID. This is a number that is unique to the player for the duration of their specific time in the game. It should not be used for permanent tracking.uniqueId: string - A unique identifier for the player that persists across game sessions. This is useful for tracking players over time.name: string - The player's name. This is the name they have chosen for themselves in the game.safeName: string - The fallback name shown in game if the player's name has been filtered due to a bad word. Usually is something like "CaptainCluck12".team: number - The team the player is on. 0 = no team (ffa), 1 = blue, 2 = redplaying: boolean - Whether the player is currently playing the game.socials: array<object> | null - An array containing the player's social media links. Here's an example object in the array:
id: number - the social media platform's ID.type: string - the type of social media platform (e.g., "Twitch", "Youtube", "Tiktok").url: string - the URL to the player's social media profile.active: boolean - Whether the social media link is active (shown on profile) or not.isVip: boolean - Whether the player is a VIP.showBadge: boolean - Whether the player has their VIP badge showing.position: object - The player's position in the game world.
x: number - The x-coordinate of the player's position.y: number - The y-coordinate of the player's position.z: number - The z-coordinate of the player's position.jumping: boolean - Whether the player is currently jumping.climbing: boolean - Whether the player is currently climbing.scoping: boolean - Whether the player is currently scoping.scale: number - The player's scale. This is either 1 (normal) or 0.5 (has the mini egg effect).view: object - The player's view direction.
yaw: number - The yaw (horizontal rotation) of the player's view - goes from 0 to Math.PI * 2pitch: number - The pitch (vertical rotation) of the player's view - 1.5 is looking straight up, -1.5 is looking straight down.inKotcZone: boolean - Whether the player is currently in the King of the Coop zone. Requires the KOTC_ZONES intent to be enabled.character: object - The player's skin information.
eggColor: Item | number - The color of the player's egg. 0-6 is normal colors, 7-13 are VIP colors.primaryGun: Item | number - The player's primary gun.secondaryGun: Item | number - The player's secondary gun.stamp: Item | number - The player's stamp.hat: Item | number - The player's hat.grenade: Item | number - The player's grenade.melee: Item | number - The player's melee weapon.stampPos: object - The position of the player's stamp.
x: number - The x-coordinate of the stamp position.y: number - The y-coordinate of the stamp position.stats: object - The player's stats.
totalKills: number - The total number of kills the player has had in the game.totalDeaths: number - The total number of deaths the player has had in the game.bestStreak: number - The player's best kill streak in the game.activeGun: number - the player's currently active gun. 0 = primary, 1 = secondaryselectedGun: number - the player's currently selected gun ID.weapons: array<weapon> - The player's weapons. Weapon is an initialized Weapon Class.grenades: number - The number of grenades the player has.streak: number - The player's current kill streak.hp: number - The player's current health. Requires the PLAYER_HEALTH intent to be enabled.hpShield: number - The player's current shield health. This ONLY works on bot.me.spawnShield: number - The player's current spawn shield tick (the flashing shield when they spawn).randomSeed: number - The random seed used for the player's next bloom shot.On a player's character property, if the COSMETIC_DATA intent is enabled, Item | number properties will be an Item object, otherwise they will be a number representing the item ID.
bot.players is an OBJECT that contains information about players in the game. The key to the object is always the player's ID, and the value is an object containing various properties about the player.
If a player leaves the game, the ID assigned to them will be reused for new players. This includes if a player leaves and rejoins the game. If you need a permanent ID for tracking, use player.uniqueId.
bot.me is an alias to the player object for the bot itself. If the bot's ID is, say, 3, then bot.players[3] is the same as bot.me.
Anytime you see a hook with a Player argument, it's equivalent to bot.players[player.id]. For example, in the playerJoined hook, the player argument is the player object for the new player.
bot.on('playerJoin', (player) => {
console.log(`Player ${player.name} joined with ID ${player.id}`);
});
Player PropsThese are all the things that appear on a Player.
id: string - The player's ID. This is a number that is unique to the player for the duration of their specific time in the game. It should not be used for permanent tracking.uniqueId: string - A unique identifier for the player that persists across game sessions. This is useful for tracking players over time.name: string - The player's name. This is the name they have chosen for themselves in the game.safeName: string - The fallback name shown in game if the player's name has been filtered due to a bad word. Usually is something like "CaptainCluck12".team: number - The team the player is on. 0 = no team (ffa), 1 = blue, 2 = redplaying: boolean - Whether the player is currently playing the game.socials: array<object> | null - An array containing the player's social media links. Here's an example object in the array:
id: number - the social media platform's ID.type: string - the type of social media platform (e.g., "Twitch", "Youtube", "Tiktok").url: string - the URL to the player's social media profile.active: boolean - Whether the social media link is active (shown on profile) or not.isVip: boolean - Whether the player is a VIP.showBadge: boolean - Whether the player has their VIP badge showing.position: object - The player's position in the game world.
x: number - The x-coordinate of the player's position.y: number - The y-coordinate of the player's position.z: number - The z-coordinate of the player's position.jumping: boolean - Whether the player is currently jumping.climbing: boolean - Whether the player is currently climbing.scoping: boolean - Whether the player is currently scoping.scale: number - The player's scale. This is either 1 (normal) or 0.5 (has the mini egg effect).view: object - The player's view direction.
yaw: number - The yaw (horizontal rotation) of the player's view - goes from 0 to Math.PI * 2pitch: number - The pitch (vertical rotation) of the player's view - 1.5 is looking straight up, -1.5 is looking straight down.inKotcZone: boolean - Whether the player is currently in the King of the Coop zone. Requires the KOTC_ZONES intent to be enabled.character: object - The player's skin information.
eggColor: Item | number - The color of the player's egg. 0-6 is normal colors, 7-13 are VIP colors.primaryGun: Item | number - The player's primary gun.secondaryGun: Item | number - The player's secondary gun.stamp: Item | number - The player's stamp.hat: Item | number - The player's hat.grenade: Item | number - The player's grenade.melee: Item | number - The player's melee weapon.stampPos: object - The position of the player's stamp.
x: number - The x-coordinate of the stamp position.y: number - The y-coordinate of the stamp position.stats: object - The player's stats.
totalKills: number - The total number of kills the player has had in the game.totalDeaths: number - The total number of deaths the player has had in the game.bestStreak: number - The player's best kill streak in the game.activeGun: number - the player's currently active gun. 0 = primary, 1 = secondaryselectedGun: number - the player's currently selected gun ID.weapons: array<weapon> - The player's weapons. Weapon is an initialized Weapon Class.grenades: number - The number of grenades the player has.streak: number - The player's current kill streak.hp: number - The player's current health. Requires the PLAYER_HEALTH intent to be enabled.hpShield: number - The player's current shield health. This ONLY works on bot.me.spawnShield: number - The player's current spawn shield tick (the flashing shield when they spawn).randomSeed: number - The random seed used for the player's next bloom shot.On a player's character property, if the COSMETIC_DATA intent is enabled, Item | number properties will be an Item object, otherwise they will be a number representing the item ID.