Hi i want to disable player xp drop on death and give it to them on respawn. So i i tried to do it using this code. $event->setXpDropAmount(0). Idk if this will disable xp drop but i got undefined error with that function. Any idea why? Or maybe alternative to setXpDropAmount to disable xp drop on death.
What class am i missing? I have playerdeathevent and entitydeathevent. setDrops is working while setXpDropAmount aren't
What is the best way to store Xp Data? Is one file yaml good or i need to make a lot of file per player name with xp as data?
The event is called *before* the player actually respawns, so any modifications to health/xp/inv contents get reset. There's probably an easier method, but you could try using a delayed task scheduled 1 tick after PlayerRespawnEvent and give xp when its run
Welpp somebody im close to make it work. I just bump into a problem does clicking Main Menu in death event screen count as PlayerQuitEvent? The XP don't save it resets to 0