Pocketmine-mp: Experience seems to dissapear on death

Created on 3 Jun 2017  路  4Comments  路  Source: pmmp/PocketMine-MP

Issue description




When using experience in my server, I noticed that xp gets - what seems like - reset everytime a player dies. Weird thing is though, that the player doesn't actually lose it's xp. Event keep inventory is set to true. When leaving the game and re-joining, all the experience seems to be back again.

What I expected to happen, was the XP remaining when dying.

Steps to reproduce the issue

  1. Set keep inventory to true with the PlayerDeathEvent.
  2. Give yourself one experience level using a plugin.
  3. Kill yourself with for example /kill.
  4. Look at the XP bar, it's empty.
  5. Rejoin the server, and look at the XP bar again. It has the previous levels again.

OS and versions

  • PocketMine-MP: api3/blocks: 7a3ee42bfa719ae5642e89672a0ab88112587890
  • PHP: 7.0
  • Server OS: Ubuntu
  • Game version: PE (possibly win10)

Crashdump, backtrace or other files

  • ...
Gameplay Not Implemented

All 4 comments

Experience is not yet implemented. This issue is invalid.

@dktapps -> Had that issue when writing exp dropping in clearsky, the old spoon version.
The attributes are getting reset, i just reproduced it. The exp attribute should not be reset when the keepinventory is set to true, but the attribute reset is called later (whilest respawning). (also probably addExperience, he might use API methods and plugins)

I repeat:

Experience is not yet implemented.

@Sandertv what you could actually do is coding into your plugin that it saves the exp attribute on death and regives it on respawn using PlayerDeathEvent and PlayerSpawn/Respawn event.

@dktapps https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/entity/Human.php#L235-L271

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MisteFr picture MisteFr  路  19Comments

L3ice picture L3ice  路  21Comments

markkrueg picture markkrueg  路  18Comments

jarne picture jarne  路  20Comments

kenygamer picture kenygamer  路  92Comments