Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

player.get(Keys.TOTAL_EXPERIENCE) Always returns 0 #312

Closed
2 of 3 tasks
BrainStone opened this issue Apr 24, 2017 · 1 comment
Closed
2 of 3 tasks

player.get(Keys.TOTAL_EXPERIENCE) Always returns 0 #312

BrainStone opened this issue Apr 24, 2017 · 1 comment
Assignees

Comments

@BrainStone
Copy link

BrainStone commented Apr 24, 2017

When trying to get the player's experience with player.get(Keys.TOTAL_EXPERIENCE).get() the value is always 0. Also player.get(ExperienceHolderData.class).get().totalExperience().get() is always 0.

I am currently running...

  • SpongeVanilla version: 1.11.2-6.0.0-BETA-253, 1.11.2-6.0.0-BETA-252 and 1.11.2-6.0.0-BETA-243
  • Java version: 1.8.0_121
  • Operating System:
  • Linux (Debian)
  • macOS
  • Windows

What is the expected result?
To recieve the amount of experience a player has.

What is the current result?
Always 0.

Example plugin
https://gist.github.com/ryantheleach/0ab39f10e1879fd04b0b2c7c4018f25d

@BrainStone BrainStone changed the title player.get(Keys.TOTAL_EXPERIENCE).get() Always returns 0 player.get(Keys.TOTAL_EXPERIENCE).get() Always returns 0 Apr 24, 2017
@BrainStone BrainStone changed the title player.get(Keys.TOTAL_EXPERIENCE).get() Always returns 0 player.get(Keys.TOTAL_EXPERIENCE) Always returns 0 Apr 24, 2017
@stephan-gh stephan-gh self-assigned this Apr 25, 2017
@stephan-gh
Copy link
Contributor

stephan-gh commented Apr 25, 2017

I can't reproduce this. It works fine with 1.11.2-6.0.0-BETA-253. One thing I did notice is that experience given with /xp <levels>L [player] (so giving levels directly, not absolute experience) does not seem to count into TOTAL_EXPERIENCE but that seems to be just how the server counts it. (It tracks levels and total experience separately.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants