Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change bot.experience.points to bot.score, the packed has been mislabeled #3125

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export interface Bot extends TypedEmitter<BotEvents> {
food: number
foodSaturation: number
oxygenLevel: number
score: number
physics: PhysicsOptions
physicsEnabled: boolean
time: Time
Expand Down Expand Up @@ -501,7 +502,6 @@ export interface GameSettings {

export interface Experience {
level: number
points: number
progress: number
}

Expand Down
5 changes: 3 additions & 2 deletions lib/plugins/experience.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ module.exports = inject
function inject (bot) {
bot.experience = {
level: null,
points: null,
progress: null
}
bot.score = null

bot._client.on('experience', (packet) => {
bot.experience.level = packet.level
bot.experience.points = packet.totalExperience
bot.score = packet.totalExperience
bot.experience.progress = packet.experienceBar
bot.emit('experience')
})
Expand Down